[NativeAOT] Use trimmable typemap in PublishAot debug builds#12147
Open
simonrozsival wants to merge 2 commits into
Open
[NativeAOT] Use trimmable typemap in PublishAot debug builds#12147simonrozsival wants to merge 2 commits into
simonrozsival wants to merge 2 commits into
Conversation
Select the typemap default from PublishAot instead of the resolved Android runtime so CoreCLR Debug builds of NativeAOT projects exercise the trimmable path. Preserve explicit typemap overrides and add a regression test.\n\nFollow-up to #12121.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: 4f9c5a7e-e73b-4cc2-8c1d-05c29795c5a4
Document why the typemap default must be selected from PublishAot instead of the resolved Android runtime. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4f9c5a7e-e73b-4cc2-8c1d-05c29795c5a4
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the MSBuild default selection logic so that projects using PublishAot=true default to the trimmable typemap even when the resolved runtime is CoreCLR (notably Debug builds), ensuring NativeAOT projects exercise the same typemap path across configurations.
Changes:
- Default
_AndroidTypeMapImplementationtotrimmablewhen$(PublishAot)=true, while keeping explicit overrides intact and retainingllvm-iras the general fallback. - Remove the now-redundant NativeAOT-specific default for
_AndroidTypeMapImplementation. - Add a regression test covering CoreCLR Debug builds with
PublishAot=trueto ensure the trimmable typemap outputs are produced.
Show a summary per file
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets | Switches typemap defaulting to be driven by PublishAot (trimmable) with llvm-ir fallback. |
| src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets | Removes the NativeAOT-only typemap default since it’s now handled in shared defaults. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs | Adds coverage verifying CoreCLR Debug + PublishAot=true uses the trimmable typemap outputs. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Default the trimmable typemap from
$(PublishAot)rather than the resolved Android runtime, so CoreCLR Debug builds of NativeAOT projects exercise the same typemap path as NativeAOT release builds.This is a follow-up to #12121, which made the trimmable typemap the default for the NativeAOT runtime.
Contributes to #10794, #11012, #8724, #10788, and #10793.
Change map
Microsoft.Android.Sdk.DefaultProperties.targets— selecttrimmablewhen$(PublishAot)=true, while preserving explicit typemap overrides and thellvm-irfallback.Microsoft.Android.Sdk.NativeAOT.targets— remove the now-redundant runtime-specific typemap default.TrimmableTypeMapBuildTests— add a CoreCLR Debug regression test for a project withPublishAot=true.Local validation
PublishAot=true+ CoreCLR defaults totrimmable.PublishAotdefaults tollvm-ir.