Skip to content

[maccatalyst][coreclr] Fix native build failure on Xcode 26.2#124220

Merged
davidnguyen-tech merged 2 commits intodotnet:mainfrom
davidnguyen-tech:fix-maccatalyst-cmake-deployment-target
Feb 19, 2026
Merged

[maccatalyst][coreclr] Fix native build failure on Xcode 26.2#124220
davidnguyen-tech merged 2 commits intodotnet:mainfrom
davidnguyen-tech:fix-maccatalyst-cmake-deployment-target

Conversation

@davidnguyen-tech
Copy link
Member

@davidnguyen-tech davidnguyen-tech commented Feb 10, 2026

Summary

Remove CMAKE_OSX_DEPLOYMENT_TARGET from the maccatalyst cmake args in eng/native/build-commons.sh.

Problem

Building for maccatalyst fails on Xcode 26.2 with:

clang: error: invalid version number in '-mmacosx-version-min=17.0'

The build sets CMAKE_SYSTEM_NAME=Darwin with CMAKE_OSX_SYSROOT=macosx, so CMake interprets CMAKE_OSX_DEPLOYMENT_TARGET=17.0 as a macOS deployment target and emits -mmacosx-version-min=17.0. But 17.0 is a Mac Catalyst version number, not a macOS version. Older clang accepted this silently; Xcode 26.2's clang rejects it as a hard error during CMake's compiler test, before configurecompiler.cmake can apply the correct -target arm64-apple-ios17.0-macabi triple.

Fix

Remove CMAKE_OSX_DEPLOYMENT_TARGET entirely. The value is not consumed — the effective Catalyst minimum version is enforced separately via the -target *-apple-ios<version>-macabi triple in eng/native/configurecompiler.cmake.

Validation

Full clr+clr.runtime+libs+packs build for maccatalyst-arm64 succeeds with this change on Xcode 26.2 / CMake 4.2.0.

Copilot AI review requested due to automatic review settings February 10, 2026 13:26
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Feb 10, 2026
@davidnguyen-tech
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@davidnguyen-tech davidnguyen-tech added os-maccatalyst MacCatalyst OS and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Feb 10, 2026
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

Removes an invalid macOS deployment target setting from the Mac Catalyst native CMake configuration to unblock builds on Xcode 26.2, where clang now hard-errors on -mmacosx-version-min=17.0.

Changes:

  • Drop -DCMAKE_OSX_DEPLOYMENT_TARGET=17.0 from the maccatalyst CMake args so CMake’s compiler test uses a valid macOS min-version.
  • Keep Mac Catalyst targeting driven by the explicit *-apple-ios17.0-macabi target triple applied later by configurecompiler.cmake.

@davidnguyen-tech davidnguyen-tech changed the title Fix maccatalyst native build failure on Xcode 26.2 [maccatalyst][coreclr] Fix native build failure on Xcode 26.2 Feb 10, 2026
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Feb 10, 2026
@davidnguyen-tech
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@davidnguyen-tech davidnguyen-tech added area-Infrastructure-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Feb 10, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

@kotlarmilos
Copy link
Member

Thanks @davidnguyen-tech. Is this failure encountered in the dotnet/dotnet build?

Having CMAKE_OSX_DEPLOYMENT_TARGET explicitly defined avoids unexpected behavior when the OS version changes. Could we set a new default minimum value?

@davidnguyen-tech
Copy link
Member Author

Thanks @davidnguyen-tech. Is this failure encountered in the dotnet/dotnet build?

Having CMAKE_OSX_DEPLOYMENT_TARGET explicitly defined avoids unexpected behavior when the OS version changes. Could we set a new default minimum value?

I haven't tried it in dotnet/dotnet yet - only in dotnet/runtime.

Yes, setting a default minimum value makes sense. Thanks for suggestion.

Use the macOS-equivalent deployment target (14.0) instead of the
Catalyst version (17.0) for CMAKE_OSX_DEPLOYMENT_TARGET. CMake
interprets this value as a macOS min-version since CMAKE_SYSTEM_NAME
is Darwin, and newer clang rejects 17.0 as an invalid macOS version.

The effective Catalyst minimum version is enforced separately via
the -target triple in eng/native/configurecompiler.cmake.
@davidnguyen-tech
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dotnet dotnet deleted a comment from azure-pipelines bot Feb 17, 2026
@dotnet dotnet deleted a comment from azure-pipelines bot Feb 17, 2026
@dotnet dotnet deleted a comment from azure-pipelines bot Feb 17, 2026
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

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@davidnguyen-tech davidnguyen-tech force-pushed the fix-maccatalyst-cmake-deployment-target branch from a95c373 to 9f1bf51 Compare February 17, 2026 12:23
@davidnguyen-tech
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@kotlarmilos kotlarmilos left a comment

Choose a reason for hiding this comment

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

Thanks!

@akoeplinger
Copy link
Member

akoeplinger commented Feb 18, 2026

we should backport this to release/10.0 (maybe after giving it some time in main to uncover unforeseen issues)

@davidnguyen-tech
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@davidnguyen-tech
Copy link
Member Author

/ba-g Everything builds on CI - subsequent failures are unrelated.

@davidnguyen-tech davidnguyen-tech merged commit fbd060d into dotnet:main Feb 19, 2026
199 of 225 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants

Comments