Android framework version
Other
Affected platform version
.NET 11
Description
|
<!-- Root *everything* for ILC, as it's already trimmed --> |
|
<TrimmerRootAssembly Include="@(_AndroidILLinkAssemblies->'%(Filename)')" Exclude="System.Private.CoreLib" TrimMode="All" /> |
This forces the compiler to consider everything that survived IL trimming as target of reflection. This is a big deoptimization. ILC has an internal/undocumented mode that does something similar (add /p:IlcTrimMetadata=false to dotnet publish and you'll get similar results to how an ILLinked IL-based app looks like under reflection). Adding this undocumented switch to a dotnet new webapiaot app doubles the size of the native AOT output, for example).
See also conversation around https://discord.com/channels/732297728826277939/732297837953679412/1444909702512119899 on discord.
We should work on ensuring this is not needed. Xamarin macios originally started with a similar TrimmerRootAssembly thing but it was removed before shipping.
The first step in getting rid of this should be to review all the UnconditionalSuppressMessage attributes in this repo.
I can help with this work.
Cc @sbomer FYI
Steps to Reproduce
Build a native AOT android app.
Did you find any workaround?
No response
Relevant log output
Android framework version
Other
Affected platform version
.NET 11
Description
android/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets
Lines 113 to 114 in c4b72d3
This forces the compiler to consider everything that survived IL trimming as target of reflection. This is a big deoptimization. ILC has an internal/undocumented mode that does something similar (add
/p:IlcTrimMetadata=falsetodotnet publishand you'll get similar results to how an ILLinked IL-based app looks like under reflection). Adding this undocumented switch to adotnet new webapiaotapp doubles the size of the native AOT output, for example).See also conversation around https://discord.com/channels/732297728826277939/732297837953679412/1444909702512119899 on discord.
We should work on ensuring this is not needed. Xamarin macios originally started with a similar TrimmerRootAssembly thing but it was removed before shipping.
The first step in getting rid of this should be to review all the
UnconditionalSuppressMessageattributes in this repo.I can help with this work.
Cc @sbomer FYI
Steps to Reproduce
Build a native AOT android app.
Did you find any workaround?
No response
Relevant log output