Skip to content

[msbuild] Stop building universal macOS 27 apps by default. Fixes #25675. - #26636

Open
rolfbjarne wants to merge 3 commits into
mainfrom
dev/rolf/fix-scaling-telegram
Open

rolfbjarne wants to merge 3 commits into
mainfrom
dev/rolf/fix-scaling-telegram

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Release builds for macOS and Mac Catalyst currently default to universal apps when no runtime identifier is specified.

Match Xcode 27 behavior by defaulting to the host architecture when SupportedOSPlatformVersion is 27.0 or later. Keep the existing universal default for earlier deployment targets, and preserve explicitly configured runtime identifiers.

Add unit coverage for the 27.0 boundary on both platforms and document the updated defaults.

Fixes #25675.

🤖 Pull request created by Copilot

rolfbjarne and others added 2 commits September 16, 2026 15:21
Stop creating universal Release apps by default when SupportedOSPlatformVersion is macOS 27.0 or later, matching Xcode 27 behavior. Keep explicit runtime identifiers and older deployment targets unchanged, and cover the version boundary.

Fixes #25675

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Apply the macOS 27 runtime identifier behavior to Mac Catalyst as well. Release builds targeting version 27.0 or later now default to the host architecture, while earlier targets remain universal and explicit runtime identifiers remain unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 16, 2026 13:23

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.

🟡 Changes recommended

Fix the omitted-version evaluation path and add corresponding test and documentation coverage.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates macOS and Mac Catalyst Release RID defaults to use the host architecture for deployment targets 27.0+.

Changes:

  • Updates MSBuild RID selection.
  • Adds 27.0 boundary tests.
  • Documents the revised defaults.
File summaries
File Summary
tests/dotnet/UnitTests/ProjectTest.cs Adds boundary coverage; unpinned SDK-supplied versions remain uncovered.
dotnet/targets/Xamarin.Shared.Sdk.props Updates version-aware RID selection; evaluation order misses omitted versions.
docs/configuration-properties.md Documents the new defaults; the unset case is not described.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread dotnet/targets/Xamarin.Shared.Sdk.props Outdated
Comment thread tests/dotnet/UnitTests/ProjectTest.cs Outdated
Comment thread docs/configuration-properties.md Outdated
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Use TargetPlatformVersion when SupportedOSPlatformVersion has not yet been populated by the .NET SDK, so unpinned macOS and Mac Catalyst 27 projects also default to the host architecture. Add regression coverage for both unpinned platforms and clarify the effective-version behavior in the documentation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🟡 Changes recommended

Defer RID selection until the effective deployment target is available and add explicit RID preservation tests.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

dotnet/targets/Xamarin.Shared.Sdk.props:190

  • bug — This fallback is evaluated from Sdk.props before the project body and later imports are evaluated. For example, a project can explicitly set SupportedOSPlatformVersion to 12.0/15.0 (tests/dotnet/Net11_0SimpleApp/macOS/Net11_0SimpleApp.csproj:5), but this code sees it as empty and uses the SDK TargetPlatformVersion (27.0) instead. Its Release build then selects the host-architecture RID rather than preserving the universal default for the earlier deployment target. Defer this RID decision until the effective project property is available, and add a regression case for a project-file value.
		<_EffectiveSupportedOSPlatformVersion Condition="'$(SupportedOSPlatformVersion)' != ''">$(SupportedOSPlatformVersion)</_EffectiveSupportedOSPlatformVersion>
		<_EffectiveSupportedOSPlatformVersion Condition="'$(_EffectiveSupportedOSPlatformVersion)' == ''">$(TargetPlatformVersion)</_EffectiveSupportedOSPlatformVersion>
		<_DefaultToUniversalDesktopApp Condition="'$(Configuration)' == 'Release' And ('$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst') And $([MSBuild]::VersionLessThan($(_EffectiveSupportedOSPlatformVersion), '27.0'))">true</_DefaultToUniversalDesktopApp>
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +54 to +60
[TestCase (ApplePlatform.MacOSX, "26.0", true)]
[TestCase (ApplePlatform.MacOSX, "27.0", false)]
[TestCase (ApplePlatform.MacOSX, null, false)]
[TestCase (ApplePlatform.MacCatalyst, "26.0", true)]
[TestCase (ApplePlatform.MacCatalyst, "27.0", false)]
[TestCase (ApplePlatform.MacCatalyst, null, false)]
public void DefaultDesktopReleaseRuntimeIdentifiers (ApplePlatform platform, string? supportedOSPlatformVersion, bool expectUniversal)
@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: b0cbaacbca6da0482e4773d37dbc206389d43d2e [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build #b0cbaac] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

0 tests crashed, 1 tests failed, 263 tests passed.

Failures

❌ dotnettests tests (macOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.DotNetProjectTest.PublishAot(MacOSX,"","Release"): App file expected at: /Users/cloudtest/vss/_work/1/s/macios/tests/dotnet/MySimpleApp/macOS/bin/Release/net11.0-macos/MySimpleA...

Html Report (VSDrops) Download

Successes

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ 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 (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. Html Report (VSDrops) Download
✅ introspection: All 7 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 31 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 25 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 25 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 25 tests passed. 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 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
⚠️ Tests on macOS Golden Gate (27): Tests skipped, incorrect beta version. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: b0cbaacbca6da0482e4773d37dbc206389d43d2e [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.

Stop building universal apps by default

3 participants