Skip to content

ci: build Apple lanes with Xcode 27.1 - #1266

Merged
AnthonyRonning merged 14 commits into
masterfrom
ci/xcode-27.1
Oct 30, 2026
Merged

AnthonyRonning merged 14 commits into
masterfrom
ci/xcode-27.1

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Why

Move every Apple job to Xcode 27.1 (27A9275), the release with the iOS 27.1 SDK and iPhone Duo support. App Store Connect requires the iOS 27 SDK from April 2027. Top of the stack: it needs PR #1264 (Tauri 2.12) and PR #1265 (UIScene adoption), because iOS 27 SDK builds abort at launch without scenes.

Rebuilt on the new ci.yml and lane planner; the old per-workflow changes are gone. The CI review's fixes are the six commits from "ci: rebuild the signed Agent when the Metal Toolchain actions change" through the docs commit. The two after them drop the Agent's strip override and fix a local Agent test for the macOS 27 SDK.

What

  1. Selector (select-xcode.py): also accepts suffixed installs such as Xcode_27.1_Release_Candidate.app, which is where Blacksmith's macOS 27 image mounts 27A9275 (GitHub's xcode-27 has Xcode_27.1.app). The exact build is still required and betas are still skipped.
  2. macOS 27 SDK fixes, no-ops on Xcode 26.5:
    • The Agent shell links Rust with Xcode's clang. nixpkgs' ld64 can't read the macOS 27 SDK's .tbd stubs (arm64e.x1).
    • Research no longer strips build scripts and proc-macros (strip = false in its dev and release build-override). Its Rust 1.94.1 strips them with a rust-objcopy that can leave a dylib's string table 4-byte aligned once the deployment target is 12 or later (Research's is 13.4), and macOS 27's dyld refuses such dylibs when they're linked against its SDK. CI's CARGO_PROFILE_DEV_DEBUG=0 makes dev builds strip too. Executables aren't checked, so shipped binaries keep their strip settings. Upstream fix: llvm/llvm-project#203680.
    • The Agent needs no override. Its Rust 1.98.0 keeps the same proc-macros 8-byte aligned at 13.4 and 15.0, and a release check of the whole app at its 15.0 target passes on Xcode 27.1. Research's comment says its override can go once the root flake pins Rust 1.98.
    • test-canonical-macho.py handles Xcode 27's ld sorting local absolute symbols.
  3. Pin and runners: apple-toolchain.json moves to 27.1/27A9275.
    • lanes.MACOS and ci.yml move to blacksmith-6vcpu-macos-27 in lockstep. So do the signed and release builders (agent-desktop-build, desktop-build, mobile-build, ios-dev-testflight, release, proxy-rust).
    • GitHub-hosted jobs that select the pinned Xcode move from macos-26 to xcode-27: Agent signing, both TestFlight submissions, release.yml's two macOS verifiers and the nightly provider suite. xcode-27 is GitHub's preview label without an SLA; repository-workflows.md lists these jobs and says what to switch to if it's renamed or retired.
    • The three verifiers that don't select Xcode stay on macos-26, where most users run the apps. "Verify downloaded macOS" is the only job that launches the signed Agent (--version, the duplicate-runtime check and the GUI smoke test), so the first macOS 27 SDK build is launched on macOS 26 before it can be published.
    • Cache vendors don't change. No job, artifact or environment is renamed.
    • The iOS ONNX Runtime builds for iOS 16.0, because Xcode 27 targets iOS 15.0–27.1 only; its hash pins move to 27A9275.
  4. Metal on Blacksmith: Blacksmith's macOS 27 image has no Metal Toolchain and can't download it.
    • A GitHub xcode-27 job exports it as a one-day artifact (.github/actions/export-metal-toolchain).
    • The jobs that compile gpui's shaders import it: the signed macOS build in agent-desktop-build.yml and the agent-package-macos rehearsal. The import skips when the toolchain is already installed.
    • In ci.yml the export is the lane metal-toolchain. Lanes now take requires, so the planner runs it exactly when agent-package-macos runs, dispatches included, and ci-ok judges it. lint checks that requirements exist and form no cycle, that a required lane selects nothing on its own and runs on no event its requirers skip, and that the requiring job needs it.
    • Both actions are inputs of the signed Agent build (AGENT_DESKTOP) and of agent-package-macos, so a master push that edits them rebuilds the signed Agent. A test derives every local action the signed builds run from the workflow.
    • The export uploads with overwrite, so "Re-run all jobs" works. A macOS build retried more than a day later needs the export job re-run too; the re-run guide and the Agent build doc say so.
    • The policy tests that keep PRs from saving caches or reading another run's artifacts now check steps inside local composite actions too, and downloads may not pass a github-token.
    • This briefly re-hosts Apple's toolchain as a run artifact in a public repo.
  5. No Metal on the faster lanes: agent-macos (PR Clippy) and agent-full-macos build gpui with runtime_shaders. Compiled shaders are still proven by master's signed Prod build on every Agent push, which "Verify downloaded macOS" then runs, plus the nightly Dev build and ci:package. The CI skill now says when ci:package is the PR proof: edits to the Metal actions, gpui/zed bumps and Xcode pin changes.
  6. Cache keys include the Xcode pin, so an upgrade never restores objects built against the previous SDK.
    • It's in the macOS lanes' cache_files and leads agent-package-macos's key prefix.
    • The signed macOS build's release key covers it too: cargo_graph_key.py takes optional pin files, and C4 expects the pin for macos-build only, so the Windows and Linux keys are unchanged. The design and debugging docs list the pin as a cold trigger.
  7. Path selection for the Research app's platform-only sources:
    • research-ios: Info.ios.plist, the plugins' Swift code and the vendored tao's iOS layer.
    • research-android: the vendored tao's Android layer, which carries Maple's null-intent hardening, and the plugins' Kotlin code. research-rust never compiles Android-only code, so an edit there ran no Android build before.
  8. Docs: the CI skill (changing-ci.md, design.md, debugging.md, outage advice), docs/ci.md, repository-workflows.md and the Agent's desktop-builds.md.

Validation

  • Local: plan.py lint, the CI script suite (551 tests), the Agent script suite in its Nix shell (259 tests) and just lane repo (every root flake check) pass.
  • Agent with Xcode 27.1, CI's CARGO_PROFILE_DEV_DEBUG=0 and no strip override: just lane agent-macos (72 s) and just lane agent-full-macos (793 s cold; 770 + 96 + 81 and smaller suites, 0 failures) pass with runtime shaders. That includes the debug app. A release cargo check of the whole app at its 15.0 deployment target passes too.
  • Stack: the earlier validation still holds. Debug and release iOS simulator builds with Xcode 27.1 ran full screen on the iPhone Duo, with cold and warm deep links. The ONNX pins reproduce locally.
  • CI run 1 (ci:package, 40810871028), before the review fixes: every lane passed except research-dev-macos.
    • metal-toolchain exported the toolchain on xcode-27, and agent-package-macos imported it on Blacksmith macOS 27 and compiled the shaders.
    • The other packaging lanes passed: research-ios (Xcode 27.1), research-desktop-macos/linux/windows, agent-package-linux/windows and agent-macos, plus every gate lane.
    • research-dev-macos exposed the dev-profile case: ci.yml sets CARGO_PROFILE_DEV_DEBUG=0, so dev builds strip proc-macros too. Reproduced locally and fixed.
  • CI run 2 (ci:research-dev-macos, 40812656344): ci-ok passes, including research-dev-macos.
  • CI run 3 (this head, no labels, 40938895983): ci-ok passes.
  • Dispatch of agent-package-macos on this head (40938899306): with no Agent strip override, metal-toolchain exported the toolchain (0.5 min), and the unsigned Dev package built, imported Metal, compiled the shaders and verified on Blacksmith macOS 27 (11.6 min).
  • Speed: ci-ok took 18.2 min, almost all of it the cold research-ios (17.4 min), the owner-accepted exception: until master saves the 27A9275 ONNX Runtime artifact, it rebuilds ONNX Runtime and downloads the iOS 27.1 Simulator runtime. The slowest of the other lanes were research-android (6.8 min), agent-macos (5.8, cold by design because the Xcode pin is in its key), os-sdk-e2e (5.0) and agent-windows (4.6). The Agent lanes are warm again: before the last commits, agent-windows compiled 196 crates and took 11.1 min, and now it compiles 3 (4.6 min). agent-test dropped from 604 crates to 10 (5.0 → 3.3 min).

Not testable before merge

Signing, TestFlight and the master-only signed builds, including the Metal export and import in agent-desktop-build.yml. The first master Agent push is the real check.

Merging

Merge PR #1264, then PR #1265, then this one, each into master with a merge commit rather than a squash. After this one merges, watch:

  • The first runs on the new runners: desktop-build, mobile-build with its TestFlight submit, ios-dev-testflight, and agent-desktop-build (the Metal export and import, then "Verify downloaded macOS" on macOS 26).
  • agent-full-macos on the merge push. It's ci:full-only on PRs, so this is its first CI run on macOS 27. If it goes red, fix forward or revert.
  • App Store Connect accepting the first Xcode 27.1 upload.
  • Master saving the 27A9275 ONNX Runtime artifact. Until then research-ios takes about 18 min on PRs, so avoid merging other iOS or CI-infra PRs in that window.
  • Research 3.4.6 is bumped but unreleased, and release.yml can't be rehearsed. The release owner decides whether it ships before this stack or after it. If after, only once this merge's desktop-build, mobile-build (including the TestFlight submit), ios-dev-testflight and proxy-rust runs are green and App Store Connect has accepted the first Xcode 27.1 upload.

Heads-up

  • Local machines need Xcode 27.1 selected globally: tauri ios build ignores DEVELOPER_DIR.
  • Agent packaging builds need 27.1's Metal Toolchain (xcodebuild -downloadComponent MetalToolchain). It's installed per Xcode version.
  • Blacksmith's 27A9275 is the release-candidate install. If an image update replaces it with a final 27.1 that has a different build number, select-xcode.py fails every Apple lane and signed build until apple-toolchain.json and the ONNX pins move.
  • rust-cache doesn't hash the Agent's manifest, because it's a virtual workspace manifest. A [profile] change there changes no cache key: Linux and Windows lanes restore master's cache as a full match and rebuild everything below a proc-macro, and master never saves a fresh cache, because a full match skips the save. An earlier version of this PR did exactly that (agent-windows took 11 min); the last commit removes it.
  • macOS 27's hdiutil warns that create, attach and convert are deprecated in favor of diskutil image. The DMG steps still work; moving them is a follow-up.

🤖 Generated with Claude Code

@AnthonyRonning

Copy link
Copy Markdown
Contributor Author

Heads-up for whoever picks this up: the Agent's macOS builds don't need to move to GitHub's xcode-27 runner. Blacksmith's macOS 27 image works once the Metal Toolchain is imported.

Evidence from the experiment in #1308 (draft, based on this branch, not for merge), run 40415895366:

  • Export: on GitHub xcode-27, xcodebuild -downloadComponent metalToolchain -exportPath … produced MetalToolchain-27A266a.exportedBundle (865 MB) in 1 s.
  • Import: on blacksmith-6vcpu-macos-27, the artifact download took about 47 s. xcodebuild -importComponent metalToolchain -importPath <bundle> then took 13 s, and xcrun metal compiled a probe shader (Apple metal 32023.921).
  • Full build: a cold cargo build --workspace --all-targets --locked of the Agent, with compiled Metal shaders, took 12m44s, plus 54 s for the Nix shell. That compares with the ~40 min on xcode-27 noted in this PR.
  • Check lanes can skip Metal entirely: with no toolchain on the runner, cargo clippy -p maple-agent-app --all-targets --locked -F gpui-platform/runtime_shaders -- -D warnings ran cold in 3m51s on Blacksmith macOS 27.

Suggested shape when this rebases:

  • Keep the unsigned Agent builders on blacksmith-6vcpu-macos-27.
  • Get the bundle from a short export job on xcode-27, or cache the exported bundle on Blacksmith keyed by the toolchain build (27A266a). Import it before building.
  • Signing, attest and verify jobs stay GitHub-hosted, as today.

The workflow is .github/workflows/macos27-blacksmith-experiment.yml on exp/macos27-blacksmith-metal.

Not urgent: CI is being rewritten in a single PR first, and this PR should rebase after that lands.

@AnthonyRonning AnthonyRonning added the ci:package Build unsigned packages on this PR label Oct 29, 2026
@AnthonyRonning
AnthonyRonning force-pushed the research/ios-scene-lifecycle branch from 7df88b2 to ddd929b Compare October 29, 2026 03:12
@AnthonyRonning AnthonyRonning added ci:research-dev-macos Build an unsigned Research Dev macOS PR package for runtime testing and removed ci:package Build unsigned packages on this PR ci:research-dev-macos Build an unsigned Research Dev macOS PR package for runtime testing labels Oct 29, 2026
@AnthonyRonning
AnthonyRonning force-pushed the research/ios-scene-lifecycle branch from ddd929b to f15adfe Compare October 29, 2026 18:31
@AnthonyRonning
AnthonyRonning removed this pull request from stack #1267 October 30, 2026 04:53
@AnthonyRonning
AnthonyRonning force-pushed the research/ios-scene-lifecycle branch from f15adfe to c03e9ad Compare October 30, 2026 04:56
Base automatically changed from research/ios-scene-lifecycle to master October 30, 2026 05:03
AnthonyRonning and others added 8 commits October 30, 2026 05:04
Blacksmith's macOS 27 image mounts 27.1 (27A9275) as
Xcode_27.1_Release_Candidate.app, while GitHub's xcode-27 image installs
it as Xcode_27.1.app. Consider Xcode_<version>_*.app installs too;
selection still requires the exact pinned build and still skips betas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These are no-ops on Xcode 26.5 and needed before the Xcode 27.1 pin.

- Agent shell: link Rust with Xcode's clang as well. nixpkgs' ld64
  cannot read the macOS 27 SDK's .tbd stubs (they list arm64e.x1), so
  build scripts failed to link (_strerror_r undefined).
- Research and Agent: stop stripping build scripts and proc-macros in
  release builds. rustc strips Apple outputs with rust-objcopy, which
  doesn't pad __LINKEDIT entries, so chained-fixup images (deployment
  target 12+) can end up with a 4-byte-aligned string table. macOS 27's
  dyld refuses such dylibs once they're linked against the macOS 27 SDK,
  so rustc could not load zerofrom-derive ("can't find crate").
  Executables aren't checked, so shipped binaries keep their strip
  settings. Upstream fix: llvm/llvm-project#203680.
- test-canonical-macho: Xcode 27's ld sorts local absolute symbols, so
  both fixtures came out in the same order. Swap the entries to recreate
  the input-order variant older linkers emitted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Xcode 27.1 (27A9275) adds the iOS 27.1 SDK and iPhone Duo support, and
App Store Connect requires the iOS 27 SDK from April 2027. The macOS 26
images have no Xcode 27, so every job that selects the pin moves:

- Blacksmith blacksmith-6vcpu-macos-26 -> blacksmith-6vcpu-macos-27:
  lanes.MACOS and ci.yml's special jobs in lockstep, plus the signed and
  release builders (agent-desktop-build, desktop-build, mobile-build,
  ios-dev-testflight, release, proxy-rust).
- GitHub macos-26 -> xcode-27: artifact verifiers, signing, TestFlight
  and the nightly provider suite.
- actionlint knows neither label yet.
- iOS ONNX Runtime builds for iOS 16.0 (the app's minimum) instead of
  13.0, because Xcode 27 only targets iOS 15.0-27.1. The hash pins move
  to 27A9275, from a local Xcode 27.1 build that reproduces them.
- Docs, the outage advice and the StoreKit harness name the new
  versions; the stale project.pbxproj.backup goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blacksmith's macOS 27 image has no Metal Toolchain for Xcode 27.1 and
cannot download it (the MobileAsset catalog fetch fails), while GitHub's
xcode-27 image ships it.

- A new export runs on xcode-27 and uploads the toolchain as a one-day
  artifact (.github/actions/export-metal-toolchain). The jobs that
  compile gpui's shaders import it (import-metal-toolchain): the signed
  macOS build in agent-desktop-build.yml and, in ci.yml, the macOS
  packaging rehearsal.
- Lanes gain `requires`. The planner adds a required lane to every plan
  that selects the lane requiring it, dispatches included, so
  metal-toolchain runs exactly when agent-package-macos does. lint
  checks that requirements exist, form no cycle, select nothing on their
  own, and that the requiring job needs them.
- agent-macos (PR Clippy) and agent-full-macos (the native suite) build
  gpui with runtime_shaders and need no Metal. Compiled shaders are
  proven by master's signed Prod build on every Agent push, the nightly
  Dev build and ci:package. Toolchain changes now also select
  agent-full-macos on master.
- Cache keys include the Xcode pin, so an upgrade never restores objects
  built against the previous SDK: the macOS lanes' cache_files, the
  packaging rehearsal's key prefix, and the signed build's release key
  (cargo_graph_key.py takes optional pin files; C4 expects the pin for
  macos-build only, so the Windows and Linux keys are unchanged).
- The policy tests know GitHub's per-Xcode labels are GitHub-hosted, so
  the attesting signing job may run on xcode-27.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The UIScene manifest (Info.ios.plist), the plugins' Swift sources and the
vendored tao's iOS platform layer only compile into the iOS app, yet no
path of research-ios covered them, so a change there ran no iOS build
unless someone added ci:ios.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ci.yml sets CARGO_PROFILE_DEV_DEBUG=0, and Cargo strips build scripts
and proc-macros whenever their profile has no debug info, so dev builds
hit the same rust-objcopy alignment bug as release builds:
research-dev-macos (tauri build --debug, deployment target 13.4) failed
with "can't find crate for `zerofrom_derive`" on Xcode 27.1. Reproduced
locally with CI's settings; the dev build-override fixes it. The Agent
gets the same setting, because its dev lanes only pass today on rustc's
default deployment target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agent-desktop-build.yml's macOS build now runs the export and import
actions, but AGENT_DESKTOP did not list them: a master push that changed
only them skipped the signed build, and no PR lane ran them without
ci:package, so a broken edit could pass ci-ok and break the next Prod
build. They join AGENT_DESKTOP and agent-package-macos's paths, a test
derives every local action the signed builds run from the workflow, and
the skill says when ci:package is the PR proof (Metal actions, gpui/zed
bumps, Xcode pin changes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Verify downloaded macOS was the only job that launches the signed Agent
(verify-release.sh runs --version, the duplicate-runtime check and the GUI
smoke test), and the Xcode 27 move put it on macOS 27, the same macOS the
build links against. It goes back to macos-26, where most users run the app,
and drops the pinned-Xcode step: it builds nothing and the image's default
Xcode suffices. Research's two artifact verifiers never select Xcode, so
they return to macos-26 as well instead of depending on the preview
xcode-27 image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AnthonyRonning and others added 6 commits October 30, 2026 05:04
- The export uploads with overwrite, so "Re-run all jobs" can upload the
  same artifact name again in the run.
- The import notes that the artifact lives one day: a later re-run needs
  the export job re-run too. It also captures `xcodebuild -showComponent`
  before matching, so grep -q cannot fail the pipeline under pipefail.
- metal-toolchain is active only where agent-package-macos is (PR side and
  nightly), so a master fallback plan never runs the export alone. lint
  now requires a required lane's events to stay within its requirers', and
  rejects an OpenSecret selector on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The policy tests that keep pull requests from saving caches or reading
another run's artifacts walked only workflow steps, and the Metal Toolchain
import is the first local composite action with an artifact step that runs
in a PR job: a `run-id` added to its download, or a cache save inside it,
passed every test. Both tests now walk each local composite action's steps
in the job that uses it, downloads may not pass a `github-token` either,
and a fixture test proves a violation inside a composite is seen. The
GITHUB_HOSTED comment no longer contradicts its pattern.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
research-android did not select the vendored tao's Android layer, which
carries Maple's null-intent hardening, nor the vendored plugins' Kotlin
sources: research-rust never compiles cfg(target_os = "android") code, so
an edit there ran no Android build without ci:android. They join its paths,
like the iOS-only sources in research-ios, which gains tao's platform/ios.rs.
The research-ios comment notes the iOS 27.1 Simulator download each run
makes on Blacksmith's macOS 27 image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…code-27

Comments and docs move with behaviour:

- The CI design, the debugging guide, repository-workflows.md and the
  macOS builder's restore comment say the macOS release key also hashes
  scripts/ci/apple-toolchain.json, so an Xcode pin change makes the next
  macOS Prod build cold.
- The Metal Toolchain artifact lives one day: the re-run guidance and the
  Agent build doc say to re-run the export job with a macOS build retried
  more than a day later.
- repository-workflows.md and the CI runner table name the jobs that depend
  on GitHub's preview xcode-27 label, and what to switch to if it is renamed
  or retired.
- changing-ci.md states the full rule for required lanes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Agent builds with Rust 1.98.0, whose stripped proc-macros keep an
8-byte-aligned string table with the macOS 27 SDK at deployment
targets 13.4 and 15.0. Research's Rust 1.94.1 leaves the same dylibs
4-byte aligned, which is what macOS 27's dyld refuses. A release check
of the whole Agent app at 15.0 passes on Xcode 27.1 without the
override, so the Agent never needed it.

It wasn't free either. The Agent's manifest is a virtual workspace
manifest, which rust-cache does not hash, so the override changed no
cache key. Linux and Windows Agent lanes restored master's cache as a
full match and rebuilt everything downstream of a proc-macro:
agent-test compiled 604 crates instead of 10, and agent-windows 196
instead of 3, taking 11 min. A full match also skips the save, so
master would never have refreshed those caches.

Research keeps both overrides. Its comment now says they can go once
the root flake pins Rust 1.98 or newer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fixture test calls rustc directly, so it linked with `cc`, which in
the Agent's Nix shell is nixpkgs' clang wrapper. Its ld64 cannot read
the macOS 27 SDK's .tbd stubs, so `just ci` failed on a Mac with Xcode
27.1 selected. The test now passes the host's
CARGO_TARGET_<host>_LINKER, which the shell sets to Xcode's clang, as
Cargo would. CI runs this suite only on Linux, where the test skips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Maple development preview: https://e7caa10f.maple-ca8.pages.dev

Commit: 0929f37ecb9e9b4d0bac6fabfd7dba2f60a83086

Uses development API, billing, flags and PCR configuration. Cloudflare Access applies.

@AnthonyRonning
AnthonyRonning marked this pull request as ready for review October 30, 2026 05:26
@AnthonyRonning
AnthonyRonning merged commit a40ff7b into master Oct 30, 2026
45 checks passed
@AnthonyRonning
AnthonyRonning deleted the ci/xcode-27.1 branch October 30, 2026 05:26

This branch was successfully deployed

1 active deployment
pages-pr-1266 — 0929f37e Deployed Oct 30, 2026 by github-actions[bot]
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.

1 participant