Fix generated source causing compilation errors on some platforms#6
Merged
LiHRaM merged 1 commit intopodimo:developfrom Aug 26, 2024
AshleighAdams:handle-empty-classnames
Merged
Fix generated source causing compilation errors on some platforms#6LiHRaM merged 1 commit intopodimo:developfrom AshleighAdams:handle-empty-classnames
LiHRaM merged 1 commit intopodimo:developfrom
AshleighAdams:handle-empty-classnames
Conversation
LiHRaM
approved these changes
Aug 25, 2024
Contributor
LiHRaM
left a comment
There was a problem hiding this comment.
Thanks for reporting and providing a fix!
On some dotnet SDKs and platforms, it's possible for an incorrect empty string to be returned by `AnalyzerConfigOptions.TryGetValue()` instead of a null when the attribute was not found While it does look to be an upstream bug, a missing class name is also not an acceptable value to begin with as it fails the build. It would be reasonable for us to check for and skip entries expressing empty class names rather than nulls for anyone on dotnet SDKs with with this bug The SDK/Platform known to be expressing this bug is 7.0.410, Linux x64 This is the current latest running on GitHub Actions for .NET 7.x As for replicating the bug, it was encountered by adding a resource for the banned API analyzer in the solutions root's `Directory.Build.props`: ```xml <ItemGroup> <GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" /> <AdditionalFiles Include="$(MSBuildThisFileDirectory)/.meta/BannedSymbols.txt" /> </ItemGroup> ```
LiHRaM
approved these changes
Aug 25, 2024
Contributor
Author
|
@LiHRaM Hey, just wondering if you're going to do a release containing this fix? |
Contributor
|
@AshleighAdams Hey, sorry about that! I've published the latest version now, thanks for your patience! |
Contributor
Author
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On some dotnet SDKs and platforms, it's possible for an incorrect empty string to be returned by
AnalyzerConfigOptions.TryGetValue()instead of a null when the attribute was not foundWhile it does look to be an upstream bug, a missing class name is also not an acceptable value to begin with as it fails the build. It would be reasonable for us to check for and skip entries expressing empty class names rather than nulls for anyone on dotnet SDKs with with this bug
The SDK/Platform known to be expressing this bug is 7.0.410, Linux x64 This is the current latest running on GitHub Actions for .NET 7.x
As for replicating the bug, it was encountered by adding a resource for the banned API analyzer in the solutions root's
Directory.Build.props: