Skip to content

[net11.0] Make CoreCLR the default runtime.#25050

Draft
rolfbjarne wants to merge 12 commits intonet11.0from
dev/rolf/coreclr-default
Draft

[net11.0] Make CoreCLR the default runtime.#25050
rolfbjarne wants to merge 12 commits intonet11.0from
dev/rolf/coreclr-default

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 UseMonoRuntime to default to false when unspecified (making CoreCLR the default runtime selection).
  • Remove previous conditional defaults that set Mono as the default except for macOS / NativeAOT publishing.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Copy link
Copy Markdown
Member

@dalexsoto dalexsoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #1e64a22] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 1e64a22bb7fdb6a0fc4ab4ecc47814b895ef56a3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 1e64a22bb7fdb6a0fc4ab4ecc47814b895ef56a3 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 11 commits April 1, 2026 17:10
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>
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #231e941] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 231e941f096c83c32f3711c0a297efa7fbd9e807 [PR build]

Copy link
Copy Markdown
Member

@dalexsoto dalexsoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀🚀

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #231e941] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 231e941f096c83c32f3711c0a297efa7fbd9e807 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🔥 [CI Build #231e941] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

3 tests crashed, 8 tests failed, 145 tests passed.

Failures

❌ dotnettests tests (iOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.DotNetProjectTest.PluralRuntimeIdentifiers(iOS,"io...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-11.0.100-p...
    • Xamarin.Tests.DotNetProjectTest.StrippedRuntimeIdentifiers(iOS,"...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-11.0.100-p...
    • Xamarin.Tests.IncrementalBuildTest.CodeChangeSkipsTargets(iOS,"i...: The target '_LinkNativeExecutable' was not executed: the target was found 1 time(s) in the binlog, but they were all skipped (B)
    • ... and 3 more

Html Report (VSDrops) Download

❌ dotnettests tests (MacCatalyst)

🔥 Failed catastrophically on VSTS: test results - dotnettests_maccatalyst (no summary found).

Html Report (VSDrops) Download

❌ dotnettests tests (tvOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.DotNetProjectTest.StrippedRuntimeIdentifiers(TVOS,...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/2/s/macios/builds/downloads/dotnet-sdk-11.0.100-p...
    • Xamarin.Tests.PostBuildTest.BuildIpaTest(TVOS,"tvos-arm64"): Unexpected stripping status: some assemblies contains methods that weren't fully stripped.
      Expected: equivalent to < "/Users...

Html Report (VSDrops) Download

❌ framework tests

🔥 Failed catastrophically on VSTS: test results - framework (no summary found).

Html Report (VSDrops) Download

❌ generator tests

🔥 Failed catastrophically on VSTS: test results - generator (no summary found).

Html Report (VSDrops) Download

❌ monotouch tests (MacCatalyst)

2 tests failed, 17 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Release (managed static registrar, all optimizations): Failed (Test run failed.
    Tests run: 3738 Passed: 3586 Inconclusive: 10 Failed: 2 Ignored: 150)
  • monotouch-test/Mac Catalyst/Release (static registrar, all optimizations): Failed (Test run failed.
    Tests run: 3738 Passed: 3586 Inconclusive: 10 Failed: 2 Ignored: 150)

Html Report (VSDrops) Download

❌ monotouch tests (tvOS)

1 tests failed, 14 tests passed.

Failed tests

  • monotouch-test/tvOS - simulator/Release (all optimizations): TimedOut

Html Report (VSDrops) Download

❌ windows tests

1 tests failed, 2 tests passed.

Failed tests

  • Remote .NET tests/Xamarin.Tests.IncrementalBuildTest.CodeChangeSkipsTargetsOnRemoteWindows(iOS,"iossimulator-arm64",False): Failed: The target '_LinkNativeExecutable' was not executed: the target was found 1 time(s) in the binlog, but they were all skipped (B)

  • Remote .NET tests/Xamarin.Tests.WindowsTest.BundleStructureWithRemoteMac(iOS,"ios-arm64",All,"Debug"): Failed: No unexpected files

  • Remote .NET tests/Xamarin.Tests.WindowsTest.PluralRuntimeIdentifiersWithRemoteMac(iOS,"ios-arm64"): Failed: 'dotnet build' failed with exit code 1

Html Report (VSDrops) Download

❌ Tests on macOS Sequoia (15) tests

1 tests failed, 4 tests passed.

Failed tests

  • monotouch-test: Failed (exit code 2)
    • No test failure details available. stderr output:
      • 2026-04-02 12:59:42.940 monotouchtest[11866:9867908] [PASS] VeryGeneric
      • 2026-04-02 12:59:42.941 monotouchtest[11866:9867908] [PASS] WrapperTypeLookupTest
      • 2026-04-02 12:59:42.941 monotouchtest[11866:9867908] Xamarin.Tests.RuntimeTest : 447.3906 ms
      • 2026-04-02 12:59:42.941 monotouchtest[11866:9867908] Xamarin.Tests : 447.4386 ms
      • 2026-04-02 12:59:42.941 monotouchtest[11866:9867908] Xamarin : 455.4196 ms
      • 2026-04-02 12:59:42.941 monotouchtest[11866:9867908] bindings-test : 455.4688 ms
      • 2026-04-02 12:59:42.951 monotouchtest[11866:9866922] Tests run: 3552 Passed: 3542 Inconclusive: 10 Failed: 0 Ignored: 189
      • 2026-04-02 12:59:42.951 monotouchtest[11866:9866922] AutoRun (): completed test run on main thread
      • 2026-04-02 12:59:42.951 monotouchtest[11866:9866922] Exiting test run with success
      • make: *** [exec-monotouch-test] Error 1

Html Report (VSDrops) Download

❌ Tests on macOS Tahoe (26) tests

1 tests failed, 4 tests passed.

Failed tests

  • monotouch-test: Failed (exit code 2)
    • No test failure details available. stderr output:
      • 2026-04-02 12:59:42.474 monotouchtest[39566:7094488] [PASS] VeryGeneric
      • 2026-04-02 12:59:42.474 monotouchtest[39566:7094488] [PASS] WrapperTypeLookupTest
      • 2026-04-02 12:59:42.475 monotouchtest[39566:7094488] Xamarin.Tests.RuntimeTest : 341.08 ms
      • 2026-04-02 12:59:42.475 monotouchtest[39566:7094488] Xamarin.Tests : 341.0944 ms
      • 2026-04-02 12:59:42.475 monotouchtest[39566:7094488] Xamarin : 349.0269 ms
      • 2026-04-02 12:59:42.475 monotouchtest[39566:7094488] bindings-test : 349.0479 ms
      • 2026-04-02 12:59:42.484 monotouchtest[39566:7093590] Tests run: 3611 Passed: 3601 Inconclusive: 10 Failed: 0 Ignored: 130
      • 2026-04-02 12:59:42.485 monotouchtest[39566:7093590] AutoRun (): completed test run on main thread
      • 2026-04-02 12:59:42.485 monotouchtest[39566:7093590] Exiting test run with success
      • make: *** [exec-monotouch-test] Error 1

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 9 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: 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 Verification

Linux build succeeded

Pipeline on Agent
Hash: 231e941f096c83c32f3711c0a297efa7fbd9e807 [PR build]

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants