-
Notifications
You must be signed in to change notification settings - Fork 128
Include all warnings under suppression setting #2930
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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
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.
Maybe warn or error instead of not setting it? I think these settings are in conflict and we should probably signal there's something wrong.
Also, I think SuppressTrimAnalysisWarnings should take precedence.
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 might be different from EnableTrimAnalyzer, as I could see wanting to just disable the linker.
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.
The way I was thinking about it it is that SuppressTrimAnalysisWarnings is the high-level user-visible property that influences the behavior of two different underlying tools. EnableTrimAnalyzer and ILLinkWarningLevel are more like escape hatches for the individual tools that people can set if they know what they're doing, so I was ok with not warning about potentially conflicting settings.
To make sure I follow, is this the suggestion?
Warns that the settings are in conflict, SuppressTrimAnalysisWarnings wins.
No warning about conflicting settings, trimmer warnings are suppressed but analyzer warnings are shown.
Why would we warn about conflicting settings in the first case but not the second? If anything, SuppressTrimAnalysisWarnings and EnableTrimAnalyzer sound like they are more in conflict to me, and as a user it wouldn't be obvious what that combination means.
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.
Hmm. That makes sense. Maybe warn for both?
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.
Do we have some mechanism where
WarningLevel
influencesILLinkWarningLevel
, or are those completely separate?(Honestly I thought we didn't have
ILLinkWarningLevel
at all - since we only haveNoWarn
and there's noILLinkNoWarn
).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.
BTW: I agree that if we should warn about something, it should be the
SuppressTrimAnalysisWarnings
versusEnableTrimAnalyzer
first - as those are more "high-level" thenILLinkWarningLevel
.Uh oh!
There was an error while loading. Please reload this page.
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.
Any of this is easy enough to tweak (for example, make linker respect
WarningLevel
directly, add anILLinkNoWarn
that by default gets set toNoWarn
, etc), but here's how it works today:WarningLevel
is likeILLinkWarningLevel
but for the compiler. Both are influenced byAnalysisLevel
(which by default is set based on the TFM).NoWarn
is a general mechanism for silencing warnings from any tool, whereas the SDK logic aroundWarningLevel
assumes it's specifically for the C# compiler.Regarding warnings:
What should be the preferred way to enable analyzer warnings but not linker warnings? Would we recommend people set
or would we recommend this?
This is kind of an advanced scenario so maybe it's ok to rely on
ILLinkWarningLevel
for this, but if we expect people to do the former then I wouldn't want that combination to warn. My current preference is not to produce any warnings.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 think this needs to be "easy" - should be rare to want this
But I guess the
SuppressTrimAnalysisWarnings
/EnableTrimAnalyzer
makes more sense in this case.I think I came around to what the code does in this PR as-is. It's not perfect, but at least it makes logical sense :-)
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.
If you agree it makes enough sense as-is, would you mind approving the PR? Thanks!