Context
#24437 (#24725) Added support for R2R which, on debug builds, does a compilation of all assemblies except user assemblies (these are considered assemblies that don't have a NuGet package id)
#25583 We r2r only SPC.dll due to excessive size
#25787 Above change had to be reverted due to x64 issues, enabled only on arm64 builds now.
Bug
For whatever reason, during the revert, this exposed a problem with the original filtering of assemblies. Normally, a composite r2r compilation receives the full set of app assemblies (this is a self contained only mode) and compiles everything. Doing an incomplete r2r compilation like we do on debug build is non standard and we are not even passing the user assemblies as a reference. This can lead to r2r tripping up when trying to load some types (only when using ReadyToRunVisibilityRootProvider). Reproduced this standalone in https://github.com/BrzVlad/repros/tree/main/maui-debug-r2r.
With the partial revert, this bug would exist only on x64 builds
Future Debug build configuration
I believe we can do better than using r2r only for SPC.dll. On android we have some infrastructure for building a profile to be passed to r2r. I believe we can do the same for iOS Debug builds, so we can obtain even better performance at the cost of minimal size increase.
Work items
Context
#24437 (#24725) Added support for R2R which, on debug builds, does a compilation of all assemblies except user assemblies (these are considered assemblies that don't have a NuGet package id)
#25583 We r2r only SPC.dll due to excessive size
#25787 Above change had to be reverted due to x64 issues, enabled only on arm64 builds now.
Bug
For whatever reason, during the revert, this exposed a problem with the original filtering of assemblies. Normally, a composite r2r compilation receives the full set of app assemblies (this is a self contained only mode) and compiles everything. Doing an incomplete r2r compilation like we do on debug build is non standard and we are not even passing the user assemblies as a reference. This can lead to r2r tripping up when trying to load some types (only when using
ReadyToRunVisibilityRootProvider). Reproduced this standalone in https://github.com/BrzVlad/repros/tree/main/maui-debug-r2r.With the partial revert, this bug would exist only on x64 builds
Future Debug build configuration
I believe we can do better than using r2r only for SPC.dll. On android we have some infrastructure for building a profile to be passed to r2r. I believe we can do the same for iOS Debug builds, so we can obtain even better performance at the cost of minimal size increase.
Work items