-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Switch to built-in IsTrimmable property #41021
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
Conversation
Trimming analyzers are finding new errors and breaking a lot. |
A new issue for fixing the NullReferenceException and NotImplementedException errors in analyzer - dotnet/linker#2718 The analyzer is finding errors that ILLink didn't report. Is that expected? I thought ILLinker was the authority but it seems like analyzers and the linker each contribute different warnings. |
We've been trying to match the warnings provided by the linker in the analyzer, so that's likely why you're hitting new issues. The analyzer is undergoing significant development, so these are new bugs that are introduced. If you file bugs we should fix them ASAP. The linker is basically the authority, and any bug where the analyzer is different is likely a bug in the analyzer -- with a few minimal exceptions around things that can't be properly represented in metadata. Thanks for turning this on, we can look through and investigate the problems. |
It will take time for analyzer fixes to be made and the dependency to flow to aspnetcore. I'll keep IsTrimmable but update this PR to disable analyzers. Can reenable once they're fixed. |
@@ -42,4 +42,10 @@ | |||
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles> | |||
</PropertyGroup> | |||
|
|||
<!-- Trim analyzers are automatically enabled by IsTrimming=true. They currently break when run on aspnetcore. | |||
Remove when trimming analyzers are fixed: https://github.com/dotnet/aspnetcore/issues/41016 --> |
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.
Would it make more sense to link to the linker issue? That way people finding this comment can go directly to the linker issue and see if it is fixed yet or not.
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'm going to leave the aspnetcore issue open with a link to the linker issue.
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.
LGTM. Just one minor nit about the comment.
<!-- Trim analyzers are automatically enabled by IsTrimming=true. They currently break when run on aspnetcore. | ||
Remove when trimming analyzers are fixed: https://github.com/dotnet/aspnetcore/issues/41016 --> | ||
<PropertyGroup> | ||
<EnableTrimAnalyzer Condition=" '$(EnableTrimAnalyzer)' == ''">false</EnableTrimAnalyzer> |
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 don't see this set anywhere else. Why include the Condition
❔
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.
Just in case we want to enable for some projects later to test whether it works or not.
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.
/fyi the Condition
doesn't help that case much because projects are read after Directory.Build.props files and (therefore) this file. The project can therefore override any property it likes (as long as it doesn't use a != ''
Condition
of course).
But my comment was definitely a nit.
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.
Just one nit 😃
Fixes #41016