[net11.0] Make CoreCLR the default runtime.#25050
[net11.0] Make CoreCLR the default runtime.#25050rolfbjarne wants to merge 15 commits intonet11.0from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the shared MSBuild props for Apple .NET SDK builds to make CoreCLR the default runtime by changing the default value of UseMonoRuntime.
Changes:
- Set
UseMonoRuntimeto default tofalsewhen unspecified (making CoreCLR the default runtime selection). - Remove previous conditional defaults that set Mono as the default except for macOS / NativeAOT publishing.
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.
Update CheckAppBundleContents to accept an isCoreCLR parameter so it can correctly filter CoreCLR-specific runtime files on all platforms (not just macOS). This includes: - CoreCLR/Mono dylib filtering based on isCoreCLR instead of platform - Framework-packaged native libraries on iOS/tvOS (libcoreclr.framework, etc.) - R2R compiled app artifacts (.r2r.dylib, BundleStructure.framework) - libxamarin-dotnet-coreclr bridge libraries - Per-rid assembly layout for CoreCLR on MacCatalyst multi-rid builds Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix a typo where UseMonoRuntime was always set to 'true' regardless of the useMonoRuntime parameter, so CoreCLR tests were never actually testing CoreCLR. Update assertions for CoreCLR: - Filter out .framework/_CodeSignature entries from the 'no other signed app bundles' check - on iOS/tvOS, CoreCLR packages native runtime libraries as signed .framework bundles. - Exclude dylibs directly in the assembly directory from the 'must be unsigned' check - on macOS/MacCatalyst, CoreCLR native runtime dylibs (libcoreclr.dylib, libSystem.*.dylib, etc.) are signed and should not be part of the customized code signing assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When CoreCLR is the default runtime, iOS/tvOS builds enable R2R compilation (CreateR2RFramework=true, CreateR2RDylib=true). The _CreateR2RFramework and _CreateR2RDylib targets invoke native toolchain tasks (CompileAppManifest, LinkNativeCode) that require Xcode/Mac SDK tools. When IsMacEnabled=false (simulating a Windows build environment), the Mac SDK is unavailable and _SdkVersion is empty, causing the CompileAppManifest task to fail with a missing parameter error. Add 'And $(IsMacEnabled) != false' to the conditions of both targets to skip R2R framework/dylib creation when building without Mac tools. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Follow the same pattern as BundleStructureTest: split the public test method into IsNotMacBuild_Mono and IsNotMacBuild_CoreCLR, each calling a private IsNotMacBuild() helper that accepts a useMonoRuntime flag. The UseInterpreter=true test case is only included in the Mono variant since the interpreter is a MonoVM-specific feature. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CoreCLR builds link against additional native runtime libraries: - On iOS/tvOS: @rpath/libcoreclr.framework/libcoreclr and friends, plus the R2R framework (@rpath/MySimpleApp.framework/MySimpleApp) - On macOS/MacCatalyst: @executable_path/.../libcoreclr.dylib and friends, plus the R2R dylib (MySimpleApp.r2r.dylib) CoreCLR None builds are also missing CryptoKit compared to MonoVM, since CoreCLR's BCL doesn't reference it. macOS is CoreCLR-only (no Mono variant), so it's only in _CoreCLR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract shared coreclrFrameworks_iOS/tvOS/MacCatalyst arrays with the CoreCLR runtime library entries. Rename the _Mono base arrays to have no suffix (common to both runtimes), then build the _Mono and _CoreCLR variants using spread expressions: _None_Mono = [.. base_None, CryptoKit] _None_CoreCLR = [.. coreclrFrameworks, .. base_None] _Full_Mono = base_Full (alias) _Full_CoreCLR = [.. coreclrFrameworks, .. base_Full] This removes ~530 lines of duplicated framework lists. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Makes future diffs easier to read when frameworks are added or removed. 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.
…CoreCLR test variants The R2R framework properties (_R2RFrameworkName, _R2RFrameworkPath, etc.) were declared inside the _PrepareR2RFrameworkCreation target, so they were only available after that target ran. In multi-RID outer builds (RuntimeIdentifiers=ios-arm64), _PrepareR2RFrameworkCreation never executes because CreateReadyToRunImages dispatches to inner builds. This left _R2RFrameworkName empty in the outer build context. _CollectR2RFrameworksForPostProcessing uses _R2RFrameworkName to populate the post-processing item list for dsymutil/strip. With an empty name it produced a path like 'Frameworks/.framework/', causing dsymutil to fail: 'cannot parse the debug map: No such file or directory'. Fix: move all R2R framework PropertyGroup declarations to a static PropertyGroup outside any target in Microsoft.Sdk.R2R.targets. DeviceSpecificIntermediateOutputPath is stable at evaluation time (set in Xamarin.Shared.props and not overridden in the .NET SDK targets), and AssemblyName is always available, so all derived properties are computed correctly in both inner builds and multi-RID outer builds. Also split PluralRuntimeIdentifiers and PluralRuntimeIdentifiersWithRemoteMac into _Mono and _CoreCLR test variants so both runtimes are covered explicitly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
With CoreCLR, C# changes don't trigger native re-linking because R2R output is a separate framework (not an input to _LinkNativeExecutable). This is different from MonoVM behavior where AOT .o files are linked into the native executable. Split CodeChangeSkipsTargets and CodeChangeSkipsTargetsOnRemoteWindows into _Mono and _CoreCLR variants to handle this difference. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
With CoreCLR (R2R), assemblies retain their IL bodies — they are not stripped the way MonoVM AOT strips method bodies. Split BuildIpaTest into _Mono and _CoreCLR variants and pass shouldStrip accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ [PR Build #59d0ab4] Build passed (Detect API changes) ✅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 |
✅ [CI Build #59d0ab4] Build passed (Build packages) ✅Pipeline on Agent |
✅ [CI Build #59d0ab4] Build passed (Build macOS tests) ✅Pipeline on Agent |
🔥 [CI Build #59d0ab4] Test results 🔥Test results❌ Tests failed on VSTS: test results 5 tests crashed, 6 tests failed, 93 tests passed. Failures❌ dotnettests tests (MacCatalyst)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ monotouch tests (iOS)🔥 Failed catastrophically on VSTS: test results - monotouch_ios (no summary found). Html Report (VSDrops) Download ❌ monotouch tests (MacCatalyst)🔥 Failed catastrophically on VSTS: test results - monotouch_maccatalyst (no summary found). Html Report (VSDrops) Download ❌ monotouch tests (macOS)🔥 Failed catastrophically on VSTS: test results - monotouch_macos (no summary found). Html Report (VSDrops) Download ❌ monotouch tests (tvOS)🔥 Failed catastrophically on VSTS: test results - monotouch_tvos (no summary found). Html Report (VSDrops) Download ❌ windows tests1 tests failed, 2 tests passed.Failed tests
Html Report (VSDrops) Download ❌ xcframework tests2 tests failed, 2 tests passed.Failed tests
Html Report (VSDrops) Download ❌ xtro tests🔥 Failed catastrophically on VSTS: test results - xtro (no summary found). Html Report (VSDrops) Download ❌ Tests on macOS Sequoia (15) tests1 tests failed, 4 tests passed.Failed tests
Html Report (VSDrops) Download ❌ Tests on macOS Tahoe (26) tests1 tests failed, 4 tests passed.Failed tests
Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
No description provided.