-
Notifications
You must be signed in to change notification settings - Fork 533
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
[Mono.Android] is now "trimming safe" #8778
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6399051
[Mono.Android] is now "trimming safe"
jonathanpeppers e4bbe8c
Changes to make diff in `AndroidEnvironment` smaller
jonathanpeppers 3e34f0f
Set `$(IlcTreatWarningsAsErrors)`
jonathanpeppers ffd33ed
One less IL2068 suppression
jonathanpeppers db695b4
[DAM] not needed on JavaCollection<T>, JavaList<T>, JavaDictionary<K,V>
jonathanpeppers 79b9908
Update justification message
jonathanpeppers 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!-- Import this to enable trim warnings of all kinds --> | ||
<Project> | ||
<PropertyGroup> | ||
<!-- Sets assembly metadata, enable analyzers --> | ||
<IsTrimmable>true</IsTrimmable> | ||
<EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer> | ||
<EnableAotAnalyzer>true</EnableAotAnalyzer> | ||
<!-- In app projects, tells ILLink to emit warnings as errors --> | ||
<ILLinkTreatWarningsAsErrors>true</ILLinkTreatWarningsAsErrors> | ||
<!-- | ||
Trim warnings, codes listed here: | ||
* https://github.com/dotnet/runtime/blob/7403a062960d092c73ce3f07d3ff323ffdf7de43/src/tools/illink/src/linker/Resources/Strings.resx | ||
* https://github.com/dotnet/docs/tree/9cb45cf9cd34f3b7259a023c3d92a124a87090d5/docs/core/deploying/trimming/trim-warnings | ||
--> | ||
<WarningsAsErrors> | ||
$(WarningsAsErrors); | ||
IL2000;IL2001;IL2002;IL2003;IL2004; | ||
IL2005;IL2006;IL2007;IL2008;IL2009; | ||
IL2010;IL2011;IL2012;IL2013;IL2014; | ||
IL2015;IL2016;IL2017;IL2018;IL2019; | ||
IL2020;IL2021;IL2022;IL2023;IL2024; | ||
IL2025;IL2026;IL2027;IL2028;IL2029; | ||
IL2030;IL2031;IL2032;IL2033;IL2034; | ||
IL2035;IL2036;IL2037;IL2038;IL2039; | ||
IL2040;IL2041;IL2042;IL2043;IL2044; | ||
IL2045;IL2046;IL2047;IL2048;IL2049; | ||
IL2050;IL2051;IL2052;IL2053;IL2054; | ||
IL2055;IL2056;IL2057;IL2058;IL2059; | ||
IL2060;IL2061;IL2062;IL2063;IL2064; | ||
IL2065;IL2066;IL2067;IL2068;IL2069; | ||
IL2070;IL2071;IL2072;IL2073;IL2074; | ||
IL2075;IL2076;IL2077;IL2078;IL2079; | ||
IL2080;IL2081;IL2082;IL2083;IL2084; | ||
IL2085;IL2086;IL2087;IL2088;IL2089; | ||
IL2090;IL2091;IL2092;IL2093;IL2094; | ||
IL2095;IL2096;IL2097;IL2098;IL2099; | ||
IL2100;IL2101;IL2102;IL2103;IL2104; | ||
IL2105;IL2106;IL2107;IL2108;IL2109; | ||
IL2110;IL2111;IL2112;IL2113;IL2114; | ||
IL2115;IL2116;IL2117;IL2118;IL2119; | ||
IL2120;IL2121;IL2122;IL2123;IL2124; | ||
IL2125;IL2126;IL2127;IL2128;IL2129; | ||
</WarningsAsErrors> | ||
<!-- In NativeAOT app projects, tells Ilc to emit warnings as errors --> | ||
<IlcTreatWarningsAsErrors>true</IlcTreatWarningsAsErrors> | ||
<!-- | ||
NativeAOT warnings, codes listed here: | ||
* https://github.com/dotnet/docs/tree/9cb45cf9cd34f3b7259a023c3d92a124a87090d5/docs/core/deploying/native-aot/warnings | ||
--> | ||
<WarningsAsErrors> | ||
jonathanpeppers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
$(WarningsAsErrors); | ||
IL3050;IL3051;IL3052;IL3053;IL3054;IL3055;IL3056; | ||
</WarningsAsErrors> | ||
</PropertyGroup> | ||
</Project> |
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.
Is this to get the analyzer warnings to be treated as errors?
For trimmer the
ILLinkTreatWarningsAsErrors
should be enough to do that.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 found it didn't work in a class library, unless I added these.
Let me look at an MSBuild log to see why.
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 can't find anything in the ILLink analyzer that would look for
$(ILLinkTreatWarningsAsErrors)
and promote the warnings to errors.I was looking here:
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.
Analyzer doesn't do this, if you need this for the analyzer you do need to use the Roslyn's properties - so
WarnAsError
orTreatWarningsAsErrors
(if you can enable it for all warnings). TheILLinkTreatWarningsAsErrors
is only forILLink
.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 think what we have here is OK for now. We could consider
$(TreatWarningsAsErrors)
as some point, but we have ~31 long-standing warnings from binding the Android API surface. There are a lot fewer now than there used to be, so it might be reasonable to fix these in .NET 9.