Skip to content

Upgrade to Xcode 26#29468

Merged
tianleiwu merged 15 commits into
mainfrom
edgchen1/xcode_26_upgrade
Jul 4, 2026
Merged

Upgrade to Xcode 26#29468
tianleiwu merged 15 commits into
mainfrom
edgchen1/xcode_26_upgrade

Conversation

@edgchen1

@edgchen1 edgchen1 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Update most Apple pipelines to use Xcode 26. Keep a build on Xcode 16 for coverage of the older toolchain.

Other fixes:

  • Patch XNNPACK to fix an iphonesimulator x86_64 build error with the newer iphonesimulator SDK.
  • Fix issue where object files were not copied from the right location for the Mac Catalyst static framework build.

Motivation and Context

Upgrade to a newer Xcode version. Xcode 16 is no longer available on some build images.

edgchen1 and others added 3 commits July 1, 2026 18:38
Bump the ADO pipelines' Xcode version to 26.3 by centralizing the default in use-xcode-version.yml and removing redundant explicit parameters. The iOS packaging pipeline moves to Xcode 26.3 with iOS simulator runtime 26.2, and the dormant post-merge job is pinned to 15.3.0. In GitHub Actions, the macOS build-and-test workflow's Xcode version is now a per-matrix-entry override (dead x86_64 branches removed), and the cpu job adds a Release build on Xcode 26.3 for new-toolchain coverage.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Flip the reusable macOS build-and-test workflow default to Xcode 26.3 so the coreml, xnnpack, and webgpu jobs build with it too, matching the packaging pipelines. Invert the cpu matrix to keep a Release build on Xcode 16 as a legacy canary. Bump the iphone_simulator job and ios.yml to Xcode 26.3 / iOS simulator 26.2, moving ios.yml from the deprecated macos-14 runner to macos-15.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tianleiwu

Copy link
Copy Markdown
Contributor

@copilot, please fix CI pipeline failures.

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@copilot, please fix CI pipeline failures.

Fixed in commit ab10544. The iOS_CI_on_Mac job was failing because Xcode 26's iOS SDK now declares _Float16 functions in math.h, and _Float16 is not supported on x86_64 simulator targets. Since the runner is macos-15 (Apple Silicon), I changed the simulator architecture from x86_64 to arm64 and bumped the minimum deployment target to 16.0.

Copilot AI requested a review from tianleiwu July 2, 2026 20:24
@edgchen1
edgchen1 force-pushed the edgchen1/xcode_26_upgrade branch from ab10544 to 737557f Compare July 2, 2026 20:31
edgchen1 and others added 9 commits July 2, 2026 16:05
The iOS 18+/macOS 15+ SDK <math.h> unconditionally declares _Float16, which clang supports on x86 only when SSE2 is enabled. XNNPACK compiles its SSE microkernels with -mno-sse2, so under the new SDK the system math module fails to precompile with "_Float16 is not supported on this target", breaking the x86_64 iOS-simulator build.

x86_64 always has SSE2 as its baseline, so compile the SSE microkernels with -msse2 -mno-sse3 (matching the SSE2 tier) on Apple x86_64 instead of -msse -mno-sse2. Other targets are unchanged. Verified with the iphonesimulator x86_64 framework build.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…raries

The macOS Catalyst (macabi) static-framework prelink copies each internal
library's object files out of its CMake object directory, which was assumed
to be ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/<lib>.dir. Libraries added via
add_subdirectory (e.g. model_package) instead place their objects under a
nested <target_binary_dir>/CMakeFiles/<lib>.dir, so the wrong directory was
walked, zero .o files were copied, and the library's symbols were silently
dropped from the prelinked object. This surfaced as undefined ModelPackage_*
symbols when linking the maccatalyst test app.

Derive each library's object directory from its own BINARY_DIR target
property so both top-level and subdirectory-defined targets resolve correctly.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The iOS simulator runtime requested for the Apple framework test is not present
on the ACES pool image, so get_simulator_device_info.py fails to find a matching
simulator. Move the test to a separate job on the Microsoft-hosted macOS-15 image
(which has the required runtime), consuming the xcframework artifact published by
the build job. The heavier xcframework build stays on the faster ACES pool.

The test job remains in the iOS_Full_xcframework stage, so a test failure still
blocks the downstream NuGet packaging stage.

Co-authored-by: Copilot <175728472+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.

Pull request overview

This PR updates Apple CI pipelines and packaging builds to use Xcode 26 (with a retained Xcode 16 build for legacy toolchain coverage), and includes build-system fixes needed to keep Apple builds working with newer SDK/toolchain behavior.

Changes:

  • Switch most Azure Pipelines and GitHub Actions macOS/iOS workflows to Xcode 26.3 + iOS simulator runtime 26.2, while keeping a legacy Xcode 16 build in the macOS workflow matrix.
  • Patch XNNPACK build flags to avoid Apple x86_64 simulator SDK build issues related to _Float16 and SSE2 requirements.
  • Fix Mac Catalyst static framework object-file staging by using the target’s own binary directory for object discovery/copying.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/ci_build/github/azure-pipelines/templates/use-xcode-version.yml Updates the default Xcode selection used across Azure Pipelines templates.
tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml Removes hard-coded Xcode 16.4, inheriting the new default Xcode version.
tools/ci_build/github/azure-pipelines/templates/py-macos.yml Removes hard-coded Xcode 16.4, inheriting the new default Xcode version.
tools/ci_build/github/azure-pipelines/templates/mac-cpu-packing-jobs.yml Removes hard-coded Xcode 16.4, inheriting the new default Xcode version.
tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml Updates iOS full xcframework build to Xcode 26.3, adds a hosted test job with simulator runtime selection, and stages artifacts more explicitly.
tools/ci_build/github/azure-pipelines/stages/plugin-mac-webgpu-stage.yml Removes hard-coded Xcode 16.4, inheriting the new default Xcode version.
tools/ci_build/github/azure-pipelines/post-merge-jobs.yml Pins a post-merge iOS dynamic framework stage to Xcode 15.3.0 to preserve older toolchain coverage.
tools/ci_build/github/azure-pipelines/mac-ios-packaging-pipeline.yml Updates packaging pipeline parameters to Xcode 26.3 and simulator runtime 26.2.
cmake/patches/xnnpack/AddEmscriptenAndIosSupport.patch Adjusts XNNPACK microkernel compile flags for Apple toolchains (armv7-a workaround and Apple x86_64 SSE2 handling).
cmake/onnxruntime.cmake Fixes Mac Catalyst object file staging by locating object dirs via the target’s binary dir.
.github/workflows/macos-ci-build-and-test-workflow.yml Forces macOS CI to run on macos-15 and defaults Xcode to 26.3 (with per-matrix override support).
.github/workflows/mac.yml Adds an Xcode 16 matrix entry for legacy coverage and bumps simulator/Xcode versions for iOS packaging.
.github/workflows/ios.yml Moves iOS CI to macos-15, switches simulator arch to arm64, and bumps Xcode/runtime versions.

Comment thread .github/workflows/macos-ci-build-and-test-workflow.yml Outdated

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

Review: Upgrade to Xcode 26

Overall this is a clean, well-scoped toolchain upgrade. The Apple pipelines move to Xcode 26.3 / iOS 26.2 simulator while retaining an Xcode 16 Release leg for legacy-toolchain coverage. A few notes.

Well done

  • use-xcode-version.yml default bumped 15.3.0 → 26.3 with a full caller audit. Templates intended to move forward drop their explicit 16.4 and inherit the new default, while post-merge-jobs.yml is explicitly pinned back to 15.3.0 to preserve its prior behavior. No caller is silently regressed.
  • Splitting iOS_Full_xcframework into a build job (ACES Sequoia pool) + a dependent test job (hosted macOS-15 with the required simulator runtime) is a sensible way to work around the missing simulator runtime on the build pool. The test_files.zip staging keeps the test inputs self-contained, and the published onnxruntime-ios-full-xcframework artifact content (the versioned xcframework zip at the artifact root) is unchanged, so the downstream nuget packaging consumer is unaffected.
  • The XNNPACK SSE2 workaround is correct and well-commented. Apple x86_64 always has SSE2, so forcing -msse2 on the SSE microkernels to satisfy the _Float16 declaration in the newer SDK's <math.h> is safe and does not affect runtime CPU dispatch.
  • The Mac Catalyst object-copy fix (get_target_property(... BINARY_DIR)) correctly locates objects for add_subdirectory targets (e.g. model_package) whose CMakeFiles/<lib>.dir is nested rather than directly under CMAKE_CURRENT_BINARY_DIR.

Minor

  • I agree with the existing observation on macos-ci-build-and-test-workflow.yml that the inline matrix docs still present x86_64 as a machine option; since the runs-on ternary now maps it to macos-15-intel (and the arch assertion in macos-ci-setup would fail on a mismatched machine), it is worth trimming/updating that comment for clarity. (Consolidated with the already-posted inline comment rather than re-posted.)
  • Not in this diff, but related: .github/actions/macos-ci-setup/action.yml still defaults xcode_version: "16". The reusable workflow now always passes an explicit value, so this default is dead, but it is a stale value worth aligning in a future cleanup.

No blocking issues from my side.

@tianleiwu
tianleiwu merged commit bb9ba7e into main Jul 4, 2026
87 checks passed
@tianleiwu
tianleiwu deleted the edgchen1/xcode_26_upgrade branch July 4, 2026 06:45
tianleiwu pushed a commit that referenced this pull request Jul 9, 2026
### Description
<!-- Describe your changes. -->

Update most Apple pipelines to use Xcode 26. Keep a build on Xcode 16
for coverage of the older toolchain.

Other fixes:
- Patch XNNPACK to fix an iphonesimulator x86_64 build error with the
newer iphonesimulator SDK.
- Fix issue where object files were not copied from the right location
for the Mac Catalyst static framework build.

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

Upgrade to a newer Xcode version. Xcode 16 is no longer available on
some build images.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
tianleiwu added a commit that referenced this pull request Jul 9, 2026
This cherry-picks the following commits for the release:

| Commit ID | PR Number | Commit Title |
|-----------|-----------|-------------|
| 56f6fee | #29038 | [CUDA] QMoE GEMV fast path for batch-1 decode |
| a2c7c3b | #29081 | Fix QMoE CPU livelock by eliminating nested
intra-op parallelism |
| bd0cb9a | #28571 | [MLAS] KleidiAI fix igemm regression |
| 5eb4aee | #29574 | Fix CustomOp forward compatibility: cap version
instead of rejecting |
| 5f49a37 | #29274 | fix(ci): incorrect identity for azcopy |
| bb9ba7e | #29468 | Upgrade to Xcode 26 |
| 36c6b7e | #29450 | Fix brew install applesimutils failure by
trusting wix/brew tap |
| a491809 | #29575 | Don't echo command when setting VSO variable in
mac-cpu-packing-jobs.yml. |
| a06675e | #29609 | Fix web e2e (npm/vite) and Python DML CI
pipelines |

Also fixed version missed by version update script.

---------

Signed-off-by: Qxiang Xu <Qixiang.Xu@arm.com>
Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com>
Signed-off-by: Martin Klacer <martin.klacer@arm.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tlwu <tlwu@example.com>
Co-authored-by: Martin Klacer <martin.klacer@arm.com>
Co-authored-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com>
Co-authored-by: Damien Dooley <damien.dooley@arm.com>
Co-authored-by: Chi Lo <54722500+chilo-ms@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Sanaa Hamel <sanaahamel@microsoft.com>
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
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