[net11.0] Fix R2R composite build for resource/framework name collisions and re-enable the x64 CoreLib composite root#25876
[net11.0] Fix R2R composite build for resource/framework name collisions and re-enable the x64 CoreLib composite root#25876kotlarmilos wants to merge 4 commits into
Conversation
…64 CoreLib root Two related fixes to the Debug CoreCLR ReadyToRun composite selection in Microsoft.Sdk.R2R.targets: 1. Fix #25867: _SelectR2RAssemblies excluded "user" assemblies from the composite by bare file name. Loose assemblies copied into resource subfolders (PublishFolderType == 'Resource', e.g. Uno tooling assets) have an empty NuGetPackageId and were misclassified as user assemblies, then added to PublishReadyToRunExclude. When such a resource copy shared a name with a framework/runtime-pack assembly (Microsoft.Extensions.Primitives.dll, which moved into the shared framework in .NET 11) the real assembly was wrongly excluded from the composite and crossgen2 failed with 'Failed to load assembly' / NETSDK1096. Restrict the candidate set to root-of-bundle managed assemblies (PublishFolderType == 'Assembly'). 2. Revert the arm64-only restriction added in #25787. The PublishReadyToRunCompositeRoots = System.Private.CoreLib optimization was scoped to arm64 because it broke x64 builds; that underlying crossgen2 issue is fixed by dotnet/runtime#129975, now backported to release/11.0-preview6, so the optimization is applied to all RuntimeIdentifiers again. Fixes #25867 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Apple-specific ReadyToRun (R2R) target logic for .NET 11 to (1) avoid R2R composite input poisoning when a resource-folder DLL shares a name with a framework/runtime-pack assembly, and (2) re-enable System.Private.CoreLib as a composite root for x64 now that the upstream crossgen2 issue is fixed.
Changes:
- Restrict the “user assembly” exclusion list to published managed assemblies (vs. resource-folder copies) to prevent filename-based collisions breaking crossgen2.
- Re-enable the
System.Private.CoreLib.dllcomposite-root optimization for all RIDs (not just-arm64).
Show a summary per file
| File | Description |
|---|---|
| dotnet/targets/Microsoft.Sdk.R2R.targets | Adjusts R2R composite filtering and composite-root configuration for net11 Apple workloads. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This is still an issue on x64: |
|
I think we need to wait for dotnet/runtime#129975 and rebase this PR on the latest darc flow |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Sorry wrong PR - It is dotnet/runtime#129574 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #0d3ba0e] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [PR Build #0d3ba0e] Build passed (Build macOS tests) ✅Pipeline on Agent |
✅ [PR Build #0d3ba0e] Build passed (Build packages) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🔥 [CI Build #0d3ba0e] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 1 tests failed, 207 tests passed. Failures❌ Tests on macOS Tahoe (26) tests [attempt 2]1 tests failed, 4 tests passed.Failed tests
Html Report (VSDrops) Download Successes✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Description
This PR improves R2R on Apple mobile in Debug.
The first fix addresses the crossgen2 failure in #25867. The
_SelectR2RAssembliestarget excluded user assemblies from the ReadyToRun composite by bare file name, but loose assemblies copied into resource subfolders of the app bundle, such as Uno'suno.ai.xamlgeneration.assetstooling assets, have aPublishFolderTypeof Resource and an emptyNuGetPackageId, so they were misclassified as user assemblies and added toPublishReadyToRunExclude.The second change re-enables the
System.Private.CoreLibcomposite-root optimization on x64. That optimization was scoped to arm64 RuntimeIdentifiers in #25787 because it regressed x64 builds with aSystem.Runtime.Intrinsics.Vector256crash, but the underlying crossgen2 issue is fixed by dotnet/runtime#129975, now backported to release/11.0-preview6, so the arm64-only restriction is removed andPublishReadyToRunCompositeRootsis applied to all RuntimeIdentifiers again.Fixes #25867
Fixes #25734