-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Enable single file analyzer in the runtime #50894
Merged
Merged
Changes from 2 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
937f893
Enable single file analyzer in the runtime
1b3dc8e
Merge branch 'main' into SingleFileAnalyzerOnRuntime
tlakollo f839417
Add IL3002 to CodeAnalysis.test.ruleset to avoid warning on tests
f92327e
Merge branch 'SingleFileAnalyzerOnRuntime' of https://github.com/tlak…
ae1bd07
Fix formating of CustomAttribute
23828b9
Fix introduced typo
9ec8520
Merge branch 'main' of https://github.com/dotnet/runtime into SingleF…
eba095e
Merge branch 'main' of https://github.com/dotnet/runtime into SingleF…
67dbd63
Merge branch 'main' of https://github.com/dotnet/runtime into SingleF…
63a395a
Fix some formatting/comments/extra pragma
91ecb47
Fix UnconditionalSuppressMessage when TFM != NetCoreAppCurrent
eb6d83a
Add more UnconditionalSuppressMessage support for TFM !=
4bfc9a8
Fix incompatibility in EventLog.csproj
6367cb9
Add System.Diagnostics.Tools if TFM is netcoreapp3.0 on
6bad341
Address some PR comments
0597dde
Merge branch 'main' of https://github.com/dotnet/runtime into SingleF…
4786f73
Change code in DependencyContext to not use Lazy
33f6916
PR feedback
b232294
Redo changes in MetadataLoadContext.csproj after checking out the main
2947adb
Merge branch 'main' of https://github.com/dotnet/runtime into SingleF…
f120ae9
Delete extra code
874f872
Disable SingleFileAnalyzer for Microsoft.XmlSerializer.Generator and
1debcce
Merge branch 'main' into SingleFileAnalyzerOnRuntime
tlakollo 870dc92
Missing message change
670bdcb
Merge branch 'SingleFileAnalyzerOnRuntime' of https://github.com/tlak…
dbb0690
PR feedback
tlakollo 0994fec
Merge branch 'main' of https://github.com/dotnet/runtime into SingleF…
tlakollo 2d47bad
Merge branch 'main' of https://github.com/dotnet/runtime into SingleF…
tlakollo df3c4bd
Merge branch 'main' of https://github.com/dotnet/runtime into SingleF…
tlakollo c2dc595
Change UnconditionalSuppressMessage for SuppressMessage since SingleFile
tlakollo ff7f84f
Merge branch 'main' of https://github.com/dotnet/runtime into SingleF…
tlakollo 305b675
Merge branch 'main' of https://github.com/dotnet/runtime into SingleF…
tlakollo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be propagated to the public API (Default property) - I would expect the analyzer to generate some warnings around this. If not it's a bug in the analyzer which we should fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried a little bit today to debug this, seems like a more complicated scenario than I expected. The analyzer is only able to see System.Lazy.Value.get but I have not found a way to connect it with the function is calling (LoadDefault). Also, I tested a similar scenario to see how does the linker behaves using RequiresUnreferencedCode and I found that they both have the same testing hole and don't produce the warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks like dotnet/linker#1912 and related.
We should get a warning in the static constructor, when the Lazy instance is getting constructed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With dotnet/linker#1964 now the Lazy call showed a warning, but since it warns on an implicit static constructor (I cannot annotate the static constructor unless I implement it) and then gets assigned to a field (which is a target that RequiresAssembly files don't support) I couldn't mark it with RequiresAssemblyFiles. I ended up refactoring the code and not make use of the Lazy call.