Skip to content

Pin XCFramework ARCHS per SDK#482

Merged
mokagio merged 1 commit intoxcframework-build-infrafrom
mokagio/xcframework-pin-archs
May 1, 2026
Merged

Pin XCFramework ARCHS per SDK#482
mokagio merged 1 commit intoxcframework-build-infrafrom
mokagio/xcframework-pin-archs

Conversation

@mokagio
Copy link
Copy Markdown
Contributor

@mokagio mokagio commented Apr 30, 2026

What?

Pin ARCHS explicitly on the xcodebuild archive invocations in build_xcframework.sh:

  • iphoneosarm64
  • iphonesimulatorarm64 x86_64

Why?

Suggested by @jkmassel on PR #401: comment thread.

The script was relying on Xcode's per-SDK default for ARCHS. Apple has been quietly trimming Intel from simulator defaults across Xcode versions, so the slice contents could shift under our feet without us changing anything.
Pinning makes the contract explicit.

The simulator slice keeps x86_64 so contributors and CI on Intel-Mac dev hosts can still run the simulator while the iOS 17 deployment target overlaps with that hardware.

Note

Stacking this on top of #401 (rather than landing it inline) because the tradeoff isn't clear-cut and I'd like @jkmassel to weigh in on whether the cost — slightly larger simulator slice, slightly longer CI builds — is worth it given how few Intel-Mac hosts realistically touch this codebase today.

How?

  • Per-SDK case resolves the right archs string before xcodebuild.
  • ARCHS="${archs}" plumbed into the existing build flag list.
  • Unknown SDK → hard error.

The resolve_slice_dir helper already accepts whatever simulator slice name Xcode emits (ios-arm64-simulator or ios-arm64_x86_64-simulator), so no downstream changes are needed.

Testing Instructions

There's no project-level test that exercises slice contents — JS, Android, and Swift-source test suites don't care which iOS arch slices the XCFramework contains.
The verification that matters (does x86_64 actually run on Intel?) needs Intel-Mac hardware neither of us has.

What CI will demonstrate: the build still completes and the publish step still uploads a slice. Anything more than that is testing Apple's tooling, which feels like theatre.


Posted by Claude Code (Opus 4.7) on behalf of @mokagio with approval.

`xcodebuild archive` was relying on Xcode's default `ARCHS` for each
SDK, which has been quietly trimming Intel from simulator slices.
Pin per-SDK so the produced slices stay stable across Xcode versions:
device → `arm64`, simulator → `arm64 x86_64`.

Keeping `x86_64` in the simulator slice lets contributors and CI on
Intel-Mac hosts run the simulator while the iOS 17 deployment target
still overlaps with that hardware.

The `resolve_slice_dir` helper already accepts whichever simulator
slice name Xcode emits, so no downstream changes are needed.

Suggested by @jkmassel on PR #401:
https://github.com/wordpress-mobile/GutenbergKit/pull/401/changes#r3025056409

---

Generated with the help of Claude Code, https://claude.ai/code

Co-Authored-By: Claude Code Opus 4.7 <noreply@anthropic.com>
@mokagio mokagio self-assigned this Apr 30, 2026
@jkmassel jkmassel added [Type] Build Tooling Issues or PRs related to build tooling iOS labels Apr 30, 2026
@jkmassel
Copy link
Copy Markdown
Contributor

I agree about the marginal benefits of continued Intel support, but I figure that as long as:

  1. Apple continues to support Xcode building for it, and
  2. Our minimum deployment target is compatible with building on Intel

We're being good platform citizens by building both slices.

If either of these assumptions change, I'm happy to remove that arch.

@mokagio mokagio merged commit c169ff7 into xcframework-build-infra May 1, 2026
19 of 21 checks passed
@mokagio mokagio deleted the mokagio/xcframework-pin-archs branch May 1, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

iOS [Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants