Skip to content

Conversation

@rolfbjarne
Copy link
Member

@rolfbjarne rolfbjarne commented Nov 28, 2025

This is a workaround for dotnet/runtime#108269, where setting PublishTrimmed=true causes problems (and this is affecting and confusing more and more people).

This is a workaround dotnet/runtime#108269, where
setting PublishTrimmed=true causes problems.
Copy link
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 modifies the build system to disallow users from setting the PublishTrimmed property to any value (including true and false), as a workaround for dotnet/runtime#108269 where setting PublishTrimmed=true causes problems. Users must instead use platform-specific properties like LinkMode (macOS) or MtouchLink (iOS/tvOS/Mac Catalyst) to configure trimming behavior.

Key Changes

  • Updated error checking in _ComputePublishTrimmed target to reject any explicit PublishTrimmed value instead of just non-true values
  • Modified test cases to validate that both PublishTrimmed=false and PublishTrimmed=true now produce build errors
  • Updated error message to clarify that setting PublishTrimmed to any value is not supported

Reviewed changes

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

File Description
dotnet/targets/Xamarin.Shared.Sdk.targets Modified _ComputePublishTrimmed target to error when PublishTrimmed is set to any value, moved error check before property calculation
tests/dotnet/UnitTests/PublishTrimmedTest.cs Added test cases for both PublishTrimmed=true and PublishTrimmed=false, updated error message assertion to match new behavior

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@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.

@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.

@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.

@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.

@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.

@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
Copy link
Collaborator

💻 [CI Build #dafc682] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: dafc6822716ee9d581e0409cca9eaf1ecee5b3b9 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 2 commits December 8, 2025 18:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #c9c6484] Build passed (Build packages) ✅

Pipeline on Agent
Hash: c9c64847e6e8341bb0785a5d95259728e5467130 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

Pipeline on Agent
Hash: c9c64847e6e8341bb0785a5d95259728e5467130 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
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: c9c64847e6e8341bb0785a5d95259728e5467130 [PR build]

@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.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #c9c6484] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: c9c64847e6e8341bb0785a5d95259728e5467130 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #c9c6484] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: c9c64847e6e8341bb0785a5d95259728e5467130 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #c9c6484] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: c9c64847e6e8341bb0785a5d95259728e5467130 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #c9c6484] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: c9c64847e6e8341bb0785a5d95259728e5467130 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #c9c6484] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: c9c64847e6e8341bb0785a5d95259728e5467130 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build #c9c6484] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

2 tests crashed, 3 tests failed, 109 tests passed.

Failures

❌ generator tests

1 tests failed, 4 tests passed.
  • Roslyn Transformer tests: TimedOut (Execution timed out after 30 minutes.)

Html Report (VSDrops) Download

❌ monotouch tests (iOS)

1 tests failed, 8 tests passed.
  • monotouch-test/iOS - simulator/Debug (interpreter): Failed

Html Report (VSDrops) Download

❌ monotouch tests (MacCatalyst)

1 tests failed, 10 tests passed.
  • monotouch-test/Mac Catalyst/Release (managed static registrar, all optimizations): Failed (Test run failed.
    Tests run: 3436 Passed: 3210 Inconclusive: 13 Failed: 1 Ignored: 225)

Html Report (VSDrops) Download

❌ xcframework tests

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

Html Report (VSDrops) Download

❌ xtro tests

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

Html Report (VSDrops) Download

Successes

✅ 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
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 9 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: c9c64847e6e8341bb0785a5d95259728e5467130 [PR build]

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.

4 participants