Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-819: Updated submodule package references to sourcegenerators #727

Closed
wants to merge 5 commits into from

Conversation

AydinE
Copy link
Contributor

@AydinE AydinE commented Mar 21, 2024

OSOE-819
Potentially fixes Lombiq/Helpful-Libraries#238 (comment)

@Piedone weirdly I can't seem to reproduce the situation from your comment even with a completely fresh clone of OSOCE, the builds and tests within the pipeline also all seem to not have any issues.

EDIT: It does seem like this time around the build did fail on this same issue: https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/actions/runs/8373846561/job/22927800545?pr=727#step:6:162

@Piedone
Copy link
Member

Piedone commented Mar 21, 2024

I get these errors still on this branch: Build log.txt

@sarahelsaig you don't?

Copy link

This pull request has merge conflicts. Please resolve those before requesting a review.

# Conflicts:
#	src/Libraries/Lombiq.HelpfulLibraries
@sarahelsaig
Copy link
Member

It works flawlessly on Rider and the dotnet CLI, but I get errors only in Visual Studio (the IE of IDEs). The actual errors can be ignored because they are straightforwardly caused by the missing generated constants. So only look at the warnings:

Generator 'ConstantFromJsonGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'.

This happens in Lombiq.BaseTheme, Lombiq.HelpfulLibraries.Tests, and Lombiq.VueJs, so all three projects that actually use the source generator. Of course System.Text.Json is part of the .NET runtime and it does work outside of Visual Studio so I'm not sure what this could mean.

Also fwiw I got this interesting IntelliSense-only warning only for Lombiq.BaseTheme, suggesting that the Lombiq.BaseTheme\package.json may have something malformed in it:

Warning	CS8785	Generator 'ConstantFromJsonGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'An item with the same key has already been added. Key: E:\Repositories\orchard-core\Open-Source-Orchard-Core-Extensions\src\Themes\Lombiq.BaseTheme\Lombiq.BaseTheme\package.json'.
System.ArgumentException: An item with the same key has already been added. Key: E:\Repositories\orchard-core\Open-Source-Orchard-Core-Extensions\src\Themes\Lombiq.BaseTheme\Lombiq.BaseTheme\package.json
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Lombiq.HelpfulLibraries.SourceGenerators.ConstantFromJsonGenerator.<Initialize>b__3_6(SourceProductionContext _, ImmutableArray`1 contents)
   at Microsoft.CodeAnalysis.UserFunctionExtensions.<>c__DisplayClass3_0`2.<WrapUserAction>b__0(TInput1 input1, TInput2 input2, CancellationToken token)
-----
	Lombiq.BaseTheme	E:\Repositories\orchard-core\Open-Source-Orchard-Core-Extensions\src\Themes\Lombiq.BaseTheme\Lombiq.BaseTheme\Lombiq.BaseTheme.csproj	1	IntelliSense	Active

(but this may be a red herring, since it works fine outside of VS)

@Piedone
Copy link
Member

Piedone commented Mar 26, 2024

Any news, @AydinE? It's a large issue that builds under VS is broken. If you can't fix this ASAP, then please revert all the changed in dev to unblock everyone.

Removed the extra folder and updated references
Copy link

This pull request has merge conflicts. Please resolve those before requesting a review.

@AydinE AydinE closed this Mar 28, 2024
@AydinE AydinE deleted the issue/OSOE-819 branch March 28, 2024 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add source generator that reads a JSON value as a const string at compile time. (OSOE-819)
4 participants