-
Notifications
You must be signed in to change notification settings - Fork 520
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 EnableTrimAnalyzer by default #21293
Comments
Agreed, we should enable this in the early previews of .NET 10 and get feedback if any 👍 |
For Android, I think we will have this change in .NET 9 RC 2 (if merged in time): So, the project template will have A customer could remove |
Do we set |
No we don't set |
Our own code shouldn't produce trim analysis warnings anymore (see #10405), so we don't need to suppress trim analysis warnings for everyone. Except: we still want to suppress trim analysis warnings if no assemblies are trimmed, because otherwise we'll get warnings for code that would otherwise be trimmed away. On the other hand, we want trim analyzer always enabled, so that warnings are reported for user code. The difference between "trim analyzer" and "trim analysis warnings" is that the former is an analyzer that analyzes the currently compiled code (which we always want), while the latter is reported by the trimmers, and as such will report warnings from *all* code, including all references. This also required bumping Touch.Unit and MonoTouch.Dialog. * New commits in xamarin/MonoTouch.Dialog: * xamarin/MonoTouch.Dialog@d157950 Exclude code that's not trimmer safe. Diff: [77b3337..d157950](https://github.com/xamarin/MonoTouch.Dialog/compare/77b3337dbbc9e3e2f1b06dab3d37d2822488b0b3..d157950b6e6ed32cf53d4074fe19223dc1f1e8fe) * New commits in xamarin/Touch.Unit: * xamarin/Touch.Unit@957faca [Touch.Client] Disable features that aren't trimmer safe. Diff: [92a0726..957faca](https://github.com/xamarin/Touch.Unit/compare/92a072683b69b2f61f235a7a249c2c7f261236d4..957facad80e753310f52fcbb8cf85219d9d6d887) Fixes #21293.
Fixed in .NET 10. |
The idea is to set
EnableTrimAnalyzers=true
by default in our targets somewhere, so that customers get trimmer warnings by default in all configurations (even if they've disabled linking in some configurations).There are a few thoughts here:
So the proposal is to just set
EnableTrimAnalyzers=true
by default.EnableTrimAnalyzers=false
).In order to minimize impact, we could enable it early on for .NET 10 to capture feedback. If it turns out too disruptive, we can also back the change out again (which is easy, because it's a very simple change).
CC @jonathanpeppers
The text was updated successfully, but these errors were encountered: