[NativeAOT] Use SDK-selected runtime pack version - #12489
[NativeAOT] Use SDK-selected runtime pack version#12489simonrozsival with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses NativeAOT publish failures caused by mixing an SDK-selected ILCompiler with an Android workload–pinned NativeAOT runtime pack by removing the Android-side runtime-pack version override so the .NET SDK selects a coherent set of versions. It also adds regression coverage intended to ensure restore is not influenced by the workload-pinned MicrosoftNETCoreAppRefPackageVersion value.
Changes:
- Remove the
LatestRuntimeFrameworkVersionoverride from the NativeAOTKnownRuntimePackentry so runtime-pack versions are SDK-selected. - Preserve the
android-armRID extension for NativeAOT runtime pack restore. - Add a new test intended to validate restore behavior with an invalid
MicrosoftNETCoreAppRefPackageVersion.
Show a summary per file
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets | Stops overriding NativeAOT runtime-pack version so SDK can select coherent ILCompiler/runtime-pack versions; keeps android-arm RID extension. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/NativeAotBuildTests.cs | Adds a regression test for NativeAOT restore version selection behavior. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
| using var builder = CreateApkBuilder (); | ||
| Assert.IsTrue ( | ||
| builder.RunTarget (proj, "Restore", parameters: [ | ||
| "MicrosoftNETCoreAppRefPackageVersion=0.0.0", | ||
| ]), | ||
| "Restore should use the .NET SDK's NativeAOT runtime pack version." | ||
| ); | ||
| } |
|
@copilot address the code review and improve the test or add more tests |
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Updated |
NativeAOT publish could pair the SDK-selected ILCompiler with an Android workload-pinned runtime pack. The resulting incompatible
System.Private.CoreLiblackedAsyncHelpers.RestoreInlinedFrameContexts.Runtime-pack resolution
LatestRuntimeFrameworkVersionoverride.android-armRID extension.Regression coverage