xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.47k stars 514 forks source link

[release/8.0.1xx-xcode15.1] Enable dedup optimization in FullAOT mode only #20701

Closed vs-mobiletools-engineering-service2 closed 4 months ago

vs-mobiletools-engineering-service2 commented 5 months ago

Description

This PR enables the dedup optimization in FullAOT mode only. The optimization can only run in FullAOT mode with complete application context. Without it, the AOT compiler may fail to collect all generic instances, and the runtime can't find them as they are searched in the dedup assembly.

Changes

This PR updates the SDK targets to enable dedup optimization in FullAOT mode only. This change doesn't depend on any runtime changes.

Verification

This PR also introduces partial AOT tests. They inspect the bundle for aot-instances.dll, which shouldn't be generated in a partial AOT compilation setup. Additionally, basic functionality is tested by asserting at app startup.

Additional notes

This change should be backported to .NET 8 as well.

Fixes https://github.com/dotnet/runtime/issues/99248

Backport of #20687

vs-mobiletools-engineering-service2 commented 5 months ago

:computer: [PR Build] Tests on macOS M1 - Mac Ventura (13.0) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Ventura (13.0) passed.

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 5 months ago

:computer: [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 5 months ago

:books: [PR Build] Artifacts :books:

Packages generated

View packages

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 5 months ago

:computer: [CI Build] Windows Integration Tests passed :computer:

:white_check_mark: All Windows Integration Tests passed.

Pipeline on Agent Hash: 6208666108c90953d68792596575e3f2b7e9b36a [PR build]

vs-mobiletools-engineering-service2 commented 5 months ago

:white_check_mark: API diff for current PR / commit

NET (empty diffs) * ~iOS~: (empty diff detected) * ~tvOS~: (empty diff detected) * ~MacCatalyst~: (empty diff detected) * ~macOS~: (empty diff detected)

:white_check_mark: API diff vs stable

.NET (No breaking changes) * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.9/9694097-1/;/stable-api-comparison/diff/dotnet/Microsoft.iOS.Ref/ref/net8.0/Microsoft.iOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/af3952582d9619be57ef360845fcd46e) (No breaking changes) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.9/9694097-1/;/stable-api-comparison/diff/dotnet/Microsoft.tvOS.Ref/ref/net8.0/Microsoft.tvOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/a09d5f9424b6428cf3d6562e8b889823) (No breaking changes) * MacCatalyst: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.9/9694097-1/;/stable-api-comparison/diff/dotnet/Microsoft.MacCatalyst.Ref/ref/net8.0/Microsoft.MacCatalyst.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/1e6984430fd50b5e70c3cd8d2e949edf) (No breaking changes) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.9/9694097-1/;/stable-api-comparison/diff/dotnet/Microsoft.macOS.Ref/ref/net8.0/Microsoft.macOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/6cc4ee9205014925e9ae6d214cc287cc) (No breaking changes) * Microsoft.iOS vs Microsoft.MacCatalyst: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.9/9694097-1/;/stable-api-comparison/diff/dotnet/iOS-MacCatalyst-diff/Microsoft.iOS.Ref/ref/net8.0/Microsoft.iOS.MacCatalyst.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/7770aadd17000b4db5f47793acc55247)

:information_source: Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent Hash: 6208666108c90953d68792596575e3f2b7e9b36a [PR build]

vs-mobiletools-engineering-service2 commented 5 months ago

:rocket: [CI Build] Test results :rocket:

Test results

:white_check_mark: All tests passed on VSTS: simulator tests.

:tada: All 95 tests passed :tada:

Tests counts

:white_check_mark: cecil: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: fsharp: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: framework: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: generator: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: interdependent_binding_projects: All 4 tests passed. Html Report (VSDrops) Download :warning: install_source: No tests selected. Html Report (VSDrops) Download :white_check_mark: introspection: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: linker: All 40 tests passed. Html Report (VSDrops) Download :warning: mac_binding_project: No tests selected. Html Report (VSDrops) Download :warning: mmp: No tests selected. Html Report (VSDrops) Download :warning: mononative: No tests selected. Html Report (VSDrops) Download :white_check_mark: monotouch: All 29 tests passed. Html Report (VSDrops) Download :white_check_mark: msbuild: All 2 tests passed. Html Report (VSDrops) Download :warning: mtouch: No tests selected. Html Report (VSDrops) Download :warning: xammac: No tests selected. Html Report (VSDrops) Download :white_check_mark: xcframework: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent Hash: 6208666108c90953d68792596575e3f2b7e9b36a [PR build]