Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Don't suppress all warnings with SuppressTrimAnalysisWarnings - #3003

Merged
sbomer merged 5 commits into
dotnet:mainfrom
sbomer:noTrimWarn
Aug 25, 2022
Merged

sbomer merged 5 commits into
dotnet:mainfrom
sbomer:noTrimWarn

Conversation

@sbomer

@sbomer sbomer commented Aug 25, 2022 •

Copy link
Copy Markdown
Member

This replaces #2930 with a different approach. Now SuppressTrimAnalysisWarnings only suppresses those warnings defined to be part of the "trim analysis" category, using a separate command-line argument.
An exception is 5.0 apps, where the setting continues to suppress specific warnings for compatibility.

Fixes #2982

@sbomer
sbomer marked this pull request as ready for review August 25, 2022 18:14
@sbomer
sbomer requested a review from marek-safar as a code owner August 25, 2022 18:14

@jtschuster jtschuster left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure I understand this, it looks like compared to #2930, we're just moving the logic for SuppressTrimAnalysisWarnings to the linker instead of MSBuild; is that right? And I guess custom steps can opt in to suppressing their warnings if they use the "TrimAnalysis" subcategory. Looks good to me if that's the case.

@sbomer

sbomer commented Aug 25, 2022 •

Copy link
Copy Markdown
Member Author

Yup, that's right. Instead of updating the NoWarn list in the targets, we just have to keep GetDiagnosticSubcategory up to date.

@tlakollo tlakollo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me :)

@sbomer
sbomer merged commit b23be78 into dotnet:main Aug 25, 2022
sbomer added a commit to sbomer/linker that referenced this pull request Aug 25, 2022
…#3003)

This replaces
dotnet@82c6dc6
with a different approach. Now SuppressTrimAnalysisWarnings only
suppresses those warnings defined to be part of the "trim analysis"
category, using a separate command-line argument.  An exception is 5.0
apps, where the setting continues to suppress specific warnings for
compatibility.
sbomer added a commit that referenced this pull request Aug 29, 2022
…#3005)

This replaces
82c6dc6
with a different approach. Now SuppressTrimAnalysisWarnings only
suppresses those warnings defined to be part of the "trim analysis"
category, using a separate command-line argument.  An exception is 5.0
apps, where the setting continues to suppress specific warnings for
compatibility.
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
…/linker#3003)

This replaces
https://github.com/dotnet/linker/commit/dotnet/linker@82c6dc6f82aeb90cfbe509ae07cf539eecb75550
with a different approach. Now SuppressTrimAnalysisWarnings only
suppresses those warnings defined to be part of the "trim analysis"
category, using a separate command-line argument.  An exception is 5.0
apps, where the setting continues to suppress specific warnings for
compatibility.


Commit migrated from dotnet/linker@b23be78
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET 7 RC 1 how to show a warning from a linker step?

3 participants