Add --strip-il-bodies crossgen2 arg for Apple mobile RIDs#53947
Merged
kotlarmilos merged 4 commits intodotnet:mainfrom Apr 28, 2026
Merged
Add --strip-il-bodies crossgen2 arg for Apple mobile RIDs#53947kotlarmilos merged 4 commits intodotnet:mainfrom
kotlarmilos merged 4 commits intodotnet:mainfrom
Conversation
Mirror the changes from dotnet/runtime#125647. For Apple mobile RIDs (ios-, tvos-, iossimulator-, tvossimulator-, maccatalyst-), pass --strip-il-bodies to crossgen2 by default via PublishReadyToRunCrossgen2ExtraArgs when composite R2R is enabled, controllable via the PublishReadyToRunStripILBodies MSBuild property. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the SDK’s ReadyToRun crossgen2 invocation defaults for Apple mobile RuntimeIdentifiers to match dotnet/runtime behavior, enabling IL body stripping when composite ReadyToRun compilation is used.
Changes:
- Append
--strip-il-bodiestoPublishReadyToRunCrossgen2ExtraArgsforios-,tvos-,iossimulator-,tvossimulator-, andmaccatalyst-RIDs. - Gate the new flag on
PublishReadyToRunComposite=true(since crossgen2 only accepts it in composite mode) and allow opt-out viaPublishReadyToRunStripILBodies=false.
This was referenced Apr 17, 2026
rolfbjarne
approved these changes
Apr 17, 2026
Member
jkoritzinsky
left a comment
There was a problem hiding this comment.
How would this interact with the partial R2R functionality?
We may need to limit this to non-partial R2R compilations (so make it another parameter on RunReadyToRunCompiler and dynamically add it in the correct cases).
Address review feedback: instead of injecting --strip-il-bodies via PublishReadyToRunCrossgen2ExtraArgs (which applies to every crossgen2 invocation, including per-assembly partial R2R compilations batched through the same target), expose a new Crossgen2CompositeExtraCommandLineArgs parameter on the RunReadyToRunCompiler task and append it only when the CompilationEntry is the composite build entry (CreateCompositeImage=true and PartialCompile=false). Also skip the flag when PublishReadyToRunPartialAssemblies or PublishReadyToRunCompositeExclusions are specified, since those scenarios leave some methods IL-only and need the IL bodies at runtime. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
@jkoritzinsky Introduced PublishReadyToRunCrossgen2CompositeExtraArgs to gate on full composite R2R compilation |
This was referenced Apr 21, 2026
jkoritzinsky
approved these changes
Apr 21, 2026
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
jkoritzinsky
approved these changes
Apr 23, 2026
Member
Author
|
/ba-g windows jobs ran longer than the maximum time of 150 minutes |
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.
Description
Mirror the changes from dotnet/runtime#125647.
For Apple mobile RIDs (
ios-,tvos-,iossimulator-,tvossimulator-,maccatalyst-), pass--strip-il-bodiesto crossgen2 by default viaPublishReadyToRunCrossgen2ExtraArgswhen composite R2R is enabled (PublishReadyToRunComposite=true), controllable via thePublishReadyToRunStripILBodiesMSBuild property. The composite gate is required because crossgen2 only accepts--strip-il-bodiesin composite mode.