[NativeAOT] Fix incremental build test with trimmable type map - #11283
Merged
Conversation
The trimmable typemap has its own complete pipeline for Java object discovery and typemap generation (GenerateTrimmableTypeMap + JavaPeerScanner), making the AssemblyModifierPipeline steps (FindJavaObjectsStep, SaveChangedAssemblyStep, FindTypeMapObjectsStep) unnecessary. _AfterILLinkAdditionalSteps was running unconditionally for trimmable builds because its Input (link.flag) is never created when ILLink is skipped (NativeAOT+trimmable), causing MSBuild to treat the target as always out-of-date. This resulted in cascading rebuilds where the in-place assembly processing made CoreCompile reference inputs newer than its outputs. Add a condition to skip _AfterILLinkAdditionalSteps when using the trimmable typemap, matching the established pattern used throughout NativeAOT.targets. Also re-enable the NativeAOT incremental build test that was blocked by this issue. Fixes #11265 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Assisted-by: Claude:claude-opus-4.6-1m
Parameterize the test to run for both CoreCLR and NativeAOT runtimes with the trimmable typemap. The test checks for XACIC7004 error strings which are not runtime-specific. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Assisted-by: Claude:claude-opus-4.6-1m
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Android build pipeline so trimmable typemap builds stop running the legacy post-ILLink assembly-modification target, which is intended to avoid the incremental-build churn seen with NativeAOT. It also updates the corresponding trimmable typemap regression tests in the build test suite.
Changes:
- Gate
_AfterILLinkAdditionalStepsso it does not run when_AndroidTypeMapImplementationistrimmable. - Re-enable the trimmable typemap incremental-build test for NativeAOT.
- Expand the copy/mismatch regression test to run for both CoreCLR and NativeAOT.
Show a summary per file
| File | Description |
|---|---|
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets |
Skips the post-ILLink assembly modifier target for trimmable typemap builds. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs |
Updates trimmable typemap regression tests to include NativeAOT scenarios. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
Comment on lines
40
to
42
| var proj = new XamarinAndroidApplicationProject { | ||
| IsRelease = isRelease, | ||
| }; |
simonrozsival
approved these changes
May 5, 2026
simonrozsival
left a comment
Member
There was a problem hiding this comment.
The test failing in CI is unrelated
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Avoid running
_AfterILLinkAdditionalStepswhich as I understand should not be needed when using the trimmable type map. Fixes an incremental build issue with NativeAOT where this target was updating the timestamp of a shared designer assembly that is input into CoreCompile, causing CoreCompile to rerun on every incremental build.Related issues