Skip to content

[dotnet] Disable trimming when using CoreCLR in the simulator. - #25315

Merged
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/coreclr-default-trimming
May 5, 2026
Merged

rolfbjarne merged 2 commits into
mainfrom
dev/rolf/coreclr-default-trimming

Conversation

@rolfbjarne

@rolfbjarne rolfbjarne commented May 4, 2026

Copy link
Copy Markdown
Member

Fixes #25295.

Copilot AI review requested due to automatic review settings May 4, 2026 15:30
@vs-mobiletools-engineering-service2

This comment has been minimized.

2 similar comments
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

3 similar comments
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

1 similar comment
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Comment thread dotnet/targets/Xamarin.Shared.Sdk.Trimming.props Outdated
@vs-mobiletools-engineering-service2

This comment has been minimized.

Co-authored-by: Alex Soto <alex@soto.dev>
@rolfbjarne
rolfbjarne requested review from Copilot and removed request for Copilot May 5, 2026 06:20
@rolfbjarne
rolfbjarne enabled auto-merge (squash) May 5, 2026 06:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

<_DefaultLinkMode Condition="'$(_DefaultLinkMode)' == '' And '$(_SdkIsSimulator)' == 'true' And (!$(RuntimeIdentifier.Contains('arm64')) Or '$(MtouchInterpreter)' != '')">None</_DefaultLinkMode>
<!-- Linking is on by default in the simulator when building for arm64, as long as the interpreter is not enabled and using MonoVM -->
<_DefaultLinkMode Condition="'$(_DefaultLinkMode)' == '' And '$(_SdkIsSimulator)' == 'true' And '$(UseMonoRuntime)' == 'true' And $(RuntimeIdentifier.Contains('arm64')) And '$(MtouchInterpreter)' == ''">SdkOnly</_DefaultLinkMode>
<!-- Linking is off by default in the simulator when not building for arm64 and using MonOVM -->
<_DefaultLinkMode Condition="'$(_DefaultLinkMode)' == '' And '$(_SdkIsSimulator)' == 'true' And (!$(RuntimeIdentifier.Contains('arm64')) Or '$(MtouchInterpreter)' != '')">None</_DefaultLinkMode>
<!-- Linking is on by default in the simulator when building for arm64, as long as the interpreter is not enabled and using MonoVM -->
<_DefaultLinkMode Condition="'$(_DefaultLinkMode)' == '' And '$(_SdkIsSimulator)' == 'true' And '$(UseMonoRuntime)' == 'true' And $(RuntimeIdentifier.Contains('arm64')) And '$(MtouchInterpreter)' == ''">SdkOnly</_DefaultLinkMode>
<!-- Linking is off by default in the simulator when not building for arm64 and using MonOVM -->
Comment on lines +56 to +57
<!-- Default linking is off when using CoreCLR in the simulator -->
<_DefaultLinkMode Condition="'$(_DefaultLinkMode)' == '' And '$(UseMonoRuntime)' != 'true' And '$(_SdkIsSimulator)' == 'true'">None</_DefaultLinkMode>
<_DefaultLinkMode Condition="'$(_DefaultLinkMode)' == '' And '$(UseMonoRuntime)' != 'true' And '$(_PlatformName)' == 'macOS'">None</_DefaultLinkMode>

<!-- Default linking is off when using CoreCLR in the simulator -->
<_DefaultLinkMode Condition="'$(_DefaultLinkMode)' == '' And '$(UseMonoRuntime)' != 'true' And '$(_SdkIsSimulator)' == 'true'">None</_DefaultLinkMode>
<_DefaultLinkMode Condition="'$(_DefaultLinkMode)' == '' And '$(_SdkIsSimulator)' == 'true' And (!$(RuntimeIdentifier.Contains('arm64')) Or '$(MtouchInterpreter)' != '')">None</_DefaultLinkMode>
<!-- Linking is on by default in the simulator when building for arm64, as long as the interpreter is not enabled and using MonoVM -->
<_DefaultLinkMode Condition="'$(_DefaultLinkMode)' == '' And '$(_SdkIsSimulator)' == 'true' And '$(UseMonoRuntime)' == 'true' And $(RuntimeIdentifier.Contains('arm64')) And '$(MtouchInterpreter)' == ''">SdkOnly</_DefaultLinkMode>
<!-- Linking is off by default in the simulator when not building for arm64 and using MonoVM -->
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #3d4e103] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 3d4e10329e16f18fc64d51d12464e09bc90d89aa [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #3d4e103] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 3d4e10329e16f18fc64d51d12464e09bc90d89aa [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: 3d4e10329e16f18fc64d51d12464e09bc90d89aa [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #3d4e103] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 3d4e10329e16f18fc64d51d12464e09bc90d89aa [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #3d4e103] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 169 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): 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
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 13 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 13 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 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 Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 3d4e10329e16f18fc64d51d12464e09bc90d89aa [PR build]

@rolfbjarne
rolfbjarne merged commit 8f5e478 into main May 5, 2026
53 checks passed
dalexsoto pushed a commit to dotnet/maui that referenced this pull request May 22, 2026
… CoreCLR. (#35311)

### Description of Change

There are a few problems when trimming (LinkSdk) is enabled:

* Hot Reload (dotnet watch) doesn't work.
* Incremental builds can be slow, because all the SDK assemblies might
have be to be re-trimmed and re-R2R'ed again.

So remove any custom trimming configuration when using CoreCLR for iOS
and Mac Catalyst.

The default is (dotnet/macios#25315):

* Not trim simulator builds.
* Trim device builds.

Fixes dotnet/macios#25295.
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.

dotnet-watch requires MtouchLink=None for iOS Simulator projects

4 participants