Skip to content

[clr-ios] Pass references hidden from the composite to crossgen2 when building a partial composite#54576

Closed
kotlarmilos wants to merge 1 commit into
mainfrom
dev/kotlarmilos/r2r-composite-hidden-references
Closed

[clr-ios] Pass references hidden from the composite to crossgen2 when building a partial composite#54576
kotlarmilos wants to merge 1 commit into
mainfrom
dev/kotlarmilos/r2r-composite-hidden-references

Conversation

@kotlarmilos

@kotlarmilos kotlarmilos commented Jun 3, 2026

Copy link
Copy Markdown
Member

Description

When publishing a composite R2R image that covers only a subset of the BCL (e.g. only System.Private.CoreLib, with the rest excluded via PublishReadyToRunExclude), PrepareForReadyToRunCompilation flags the excluded assemblies as HideReferenceFromComposite and drops them from ReadyToRunCompositeBuildReferences, so crossgen2 receives no -r references and CoreCLR rejects the resulting image at startup.

This will be validated in dotnet/macios@44b767cf66 (PR dotnet/macios#25583).

… building a partial composite

When publishing a composite R2R image that covers only a subset of the
closure (e.g. only System.Private.CoreLib, with the rest excluded via
PublishReadyToRunExclude), PrepareForReadyToRunCompilation flags the
excluded assemblies as HideReferenceFromComposite and drops them from
ReadyToRunCompositeBuildReferences, so crossgen2 receives no -r references
and CoreCLR rejects the resulting image at startup (FailFast in
NativeImage::Open). Include those references in the composite reference
list; they remain valid -r references and only need to be excluded from
being composite inputs, which is already enforced by the existing
!eligibility.Compile check, making the change behavior-preserving for the
full-composite case while fixing partial composites.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kotlarmilos

Copy link
Copy Markdown
Member Author

Instead of excluding the non-CoreLib BCL assemblies and passing them back to crossgen2 as hidden composite references, now roots the composite on System.Private.CoreLib only and keeps the remaining framework assemblies as unrooted composite inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant