Add --strip-il-bodies crossgen2 arg for Apple mobile RIDs#53947
Add --strip-il-bodies crossgen2 arg for Apple mobile RIDs#53947kotlarmilos 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>
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.
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>
|
@jkoritzinsky Introduced PublishReadyToRunCrossgen2CompositeExtraArgs to gate on full composite R2R compilation |
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
|
/ba-g windows jobs ran longer than the maximum time of 150 minutes |
|
I suspect this change caused a regression. The job timeouts seem are related. See the failing builds at: https://dev.azure.com/dnceng-public/public/_build?definitionId=101&_a=summary&repositoryFilter=63&branchFilter=324%2C324 as well as main PRs. AI Analysis: Root cause: Commit 1ec3763 (PR #53947) added @(PublishReadyToRunPartialAssemblies) and @(PublishReadyToRunCompositeExclusions) item list references Fix: Remove the @() item checks from the PropertyGroup conditions. Since this PropertyGroup is evaluated at import time (not inside a target), item lists Please either make a quick fix or revert immediately to unblock while investigating. TIA |
This is correct, my error. I missed WebAssembly jobs and didn't notice the msbuild failure there. Please proceed with the revert and I will follow-up with #54143 |
…3947)" This reverts commit 1ec3763. The reverted change used @(ItemList) references in PropertyGroup conditions in Microsoft.NET.CrossGen.targets, which is not allowed by MSBuild (MSB4099). This breaks all builds that evaluate this file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 PublishReadyToRunCrossgen2CompositeExtraArgs when composite R2R is enabled (PublishReadyToRunComposite=true), controllable via the PublishReadyToRunStripILBodies MSBuild property. The composite gate is required because crossgen2 only accepts --strip-il-bodies in composite mode. This re-applies dotnet#53947 (reverted in dotnet#54135) with the MSB4099 fix: the property assignments that reference @(PublishReadyToRunPartialAssemblies) and @(PublishReadyToRunCompositeExclusions) items are placed inside the _PrepareForReadyToRunCompilation target body so the item references are evaluated at target time rather than at import time. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 PublishReadyToRunCrossgen2CompositeExtraArgs when composite R2R is enabled (PublishReadyToRunComposite=true), controllable via the PublishReadyToRunStripILBodies MSBuild property. The composite gate is required because crossgen2 only accepts --strip-il-bodies in composite mode. This re-applies dotnet#53947 (reverted in dotnet#54135) with the MSB4099 fix: the property assignments that reference @(PublishReadyToRunPartialAssemblies) and @(PublishReadyToRunCompositeExclusions) items are placed inside the _PrepareForReadyToRunCompilation target body so the item references are evaluated at target time rather than at import time. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 PublishReadyToRunCrossgen2CompositeExtraArgs when composite R2R is enabled (PublishReadyToRunComposite=true), controllable via the PublishReadyToRunStripILBodies MSBuild property. The composite gate is required because crossgen2 only accepts --strip-il-bodies in composite mode. This re-applies dotnet#53947 (reverted in dotnet#54135) with the MSB4099 fix: the property assignments that reference @(PublishReadyToRunPartialAssemblies) and @(PublishReadyToRunCompositeExclusions) items are placed inside the _PrepareForReadyToRunCompilation target body so the item references are evaluated at target time rather than at import time. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.