Introduce a property to specify assemblies that should be partially R2R compiled and excluded from a composite image.#53635
Merged
jkoritzinsky merged 5 commits intodotnet:mainfrom Apr 14, 2026
Conversation
…2R compiled and excluded from a composite image.
jkoritzinsky
added a commit
to jkoritzinsky/maui
that referenced
this pull request
Mar 30, 2026
…cios repo and use item groups from dotnet/sdk#53635 to enable partial generation
kotlarmilos
reviewed
Mar 31, 2026
jkoritzinsky
added a commit
to jkoritzinsky/maui
that referenced
this pull request
Mar 31, 2026
…cios repo and use item groups from dotnet/sdk#53635 to enable partial generation
…g, add warning for partial compile in composite mode - Remove redundant eligibility.CompileSeparately check (already in parent block) - Consolidate --composite flag emission to a single location - Add NETSDK1237 warning when PartialCompile is set for assemblies compiled into a composite image Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
📋 SDK Diagnostic Documentation ReminderThis PR introduces 1 new SDK diagnostic code:
Action RequiredPlease ensure that documentation for this diagnostic is added or updated in the dotnet/docs repository at:
Each diagnostic should have:
Thank you for helping keep our documentation up to date! 🙏 |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for “partial” ReadyToRun compilation of a selected set of assemblies, intended for upstack tooling scenarios (e.g., MAUI/macOS) where compiling only targeted code can speed up inner-loop Debug/F5 publishing.
Changes:
- Plumbs a new
PublishReadyToRunPartialAssembliesitem list into the ReadyToRun preparation task and marks eligible compilation entries withPartialCompile. - Updates crossgen2 invocation to emit
--partialbased on per-assembly metadata. - Adds a new warning (NETSDK1237) when partial compilation is requested but the assembly ends up in a composite image (where partial compilation is not supported).
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.CrossGen.targets | Passes @(PublishReadyToRunPartialAssemblies) into PrepareForReadyToRunCompilation. |
| src/Tasks/Microsoft.NET.Build.Tasks/RunReadyToRunCompiler.cs | Reads PartialCompile metadata and emits --partial for crossgen2; adjusts --composite emission logic. |
| src/Tasks/Microsoft.NET.Build.Tasks/PrepareForReadyToRunCompilation.cs | Introduces PublishReadyToRunPartialAssemblies, tracks partial eligibility, sets PartialCompile metadata, and warns (NETSDK1237) when ignored under composite compilation. |
| src/Tasks/Common/Resources/Strings.resx | Adds NETSDK1237 message and updates “latest message added” marker. |
| src/Tasks/Common/MetadataKeys.cs | Adds PartialCompile and R2RHeaderSymbolName metadata keys. |
| src/Tasks/Common/Resources/xlf/Strings.cs.xlf | Adds localized entry for NETSDK1237 (state=new). |
| src/Tasks/Common/Resources/xlf/Strings.de.xlf | Adds localized entry for NETSDK1237 (state=new). |
| src/Tasks/Common/Resources/xlf/Strings.es.xlf | Adds localized entry for NETSDK1237 (state=new). |
| src/Tasks/Common/Resources/xlf/Strings.fr.xlf | Adds localized entry for NETSDK1237 (state=new). |
| src/Tasks/Common/Resources/xlf/Strings.it.xlf | Adds localized entry for NETSDK1237 (state=new). |
| src/Tasks/Common/Resources/xlf/Strings.ja.xlf | Adds localized entry for NETSDK1237 (state=new). |
| src/Tasks/Common/Resources/xlf/Strings.ko.xlf | Adds localized entry for NETSDK1237 (state=new). |
| src/Tasks/Common/Resources/xlf/Strings.pl.xlf | Adds localized entry for NETSDK1237 (state=new). |
| src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf | Adds localized entry for NETSDK1237 (state=new). |
| src/Tasks/Common/Resources/xlf/Strings.ru.xlf | Adds localized entry for NETSDK1237 (state=new). |
| src/Tasks/Common/Resources/xlf/Strings.tr.xlf | Adds localized entry for NETSDK1237 (state=new). |
| src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf | Adds localized entry for NETSDK1237 (state=new). |
| src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf | Adds localized entry for NETSDK1237 (state=new). |
- Make partialImage imply exclusion from composite image in CreateCompileEligibility, so partial assemblies are always compiled separately rather than being silently included in the composite. - Remove now-unreachable warnings in composite branches since partial assemblies can no longer reach them. - Rename composite-specific parameter names in CalculateOutputPathsForContainer to generic names (r2rImageRelativePath, intermediateR2RImage) since the method is used for both composite and non-composite outputs. - Fix bug where variable rename was incorrectly applied at call site (r2rImageRelativePath was not in scope). - Add integration tests for partial R2R compilation in both non-composite and composite modes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/ba-g work item crashes unrelated or connected to the known build errors |
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.
This can be used by upstack tooling (dotnet/macios and dotnet/maui) to enable them to have crossgen2 generate a partial R2R image for Debug of a limited set of code (XAML generated code is the goal) to speed up F5 scenarios.
See dotnet/maui#34837 and dotnet/runtime#126194