[Android] Enable Composite Partial ReadyToRun on Release builds by default#33234
Merged
[Android] Enable Composite Partial ReadyToRun on Release builds by default#33234
Conversation
This was referenced Dec 29, 2025
Open
...ontrols/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.targets
Outdated
Show resolved
Hide resolved
...ontrols/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.targets
Outdated
Show resolved
Hide resolved
Member
|
/rebase |
Contributor
There was a problem hiding this comment.
Pull request overview
Enables Composite Partial ReadyToRun (R2R) by default for Android CoreCLR Release builds, and adds infrastructure to restore/package MIBC (PGO) profiles into the MAUI build tasks NuGet so those defaults have profiles available.
Changes:
- Enable
PublishReadyToRun+ composite R2R and add--partialby default for Android CoreCLR Release builds viaMicrosoft.Maui.Controls.targets. - Add an
eng/optimizationData.targetsrestore step to download/copy.mibcoptimization data into$(ArtifactsDir)\mibc. - Pack copied
.mibcfiles intoMicrosoft.Maui.Controls.Build.Tasks(buildTransitive/netstandard2.0/mibc) and add a new dependency version.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.targets | Turns on composite/partial R2R and wires default _ReadyToRunPgoFiles to packaged .mibc profiles for Android CoreCLR Release. |
| src/Controls/src/Build.Tasks/Controls.Build.Tasks.csproj | Packs .mibc files into the Build.Tasks nupkg and copies them into the build tasks output layout. |
| eng/optimizationData.targets | Introduces restore-time download/copy of MIBC optimization data into $(ArtifactsDir)\mibc. |
| eng/Versions.props | Adds the MIBC package version property. |
| eng/Version.Details.xml | Adds dependency flow entry for the MIBC package. |
| Directory.Build.targets | Imports the new optimization data restore logic repo-wide. |
| Directory.Build.props | Defines MibcOptimizationDataDir under $(ArtifactsDir). |
...ontrols/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.targets
Show resolved
Hide resolved
...ontrols/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.targets
Outdated
Show resolved
Hide resolved
...ontrols/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.targets
Outdated
Show resolved
Hide resolved
...ontrols/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.targets
Outdated
Show resolved
Hide resolved
…dd MIBC items dynamically.
571d7de to
802edba
Compare
Member
Author
|
/ba-g Test failures are irrelevant - there are the same failures in a build of net11.0 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1277799&view=results |
Member
|
/azp run maui-pr-uitests,maui-pr-devicetests |
|
Azure Pipelines successfully started running 2 pipeline(s). |
simonrozsival
approved these changes
Feb 5, 2026
Member
simonrozsival
left a comment
There was a problem hiding this comment.
CI failures appear unrelated
jfversluis
pushed a commit
that referenced
this pull request
Mar 5, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Fixes the `UseMonoRuntime` check in the R2R configuration added by #33234. `dotnet/android` does not set `UseMonoRuntime` for Release builds — it leaves the property empty/unset. **Fix:** Change the condition from `== 'false'` to `!= 'true'` so it correctly matches when `UseMonoRuntime` is empty (default in Release) or explicitly set to `false`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Closes #33387
Closes #33388
This PR enables Composite Partial ReadyToRun by default for CoreCLR on Android Release builds.
The users can customize the ReadyToRun configuration too:
truefalseto Disable R2R entirelytruefalseto Use non-composite R2R (separate native images per assembly)truefalseto Use full R2R (AOT-compile all methods, not just profiled)truefalseto Exclude MAUI's default MIBC profilesTo include custom MIBC profiles:
Progress
Microsoft.Maui.Controls.Build.Tasks.nupkg