Skip to content

ci(desktop): pin ship Xcode and fail closed on compiler-gated APIs - #13564

Merged
Git-on-my-level merged 10 commits into
mainfrom
ci/desktop-ship-xcode-pin
Sep 13, 2026
Merged

Git-on-my-level merged 10 commits into
mainfrom
ci/desktop-ship-xcode-pin

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

Closes SCA-467

Product invariants affected

Path-based (codemagic.yaml matched); this PR changes only the two desktop Swift workflows' Xcode toolchain selection — no routing, identity, or auth behavior changes:

  • INV-AUTH-1

  • INV-DATA-1

  • INV-BETA-1

  • CI budget bump (measured): the first pinned-Xcode 26.6 full lane on macos-26 (run 34687313733) was cancelled by the old 60-minute job ceiling mid-serial-cluster with every completed suite green (one wedged batch cost 1650s before its designed bisect recovered; zero test failures). desktop-swift-verify ceiling 60 → 90 min and the full-lane step budget 2700 → 4200s, both citing that run.

Failure-Class: none

Why

PR #12867 (Liquid Glass tab bar) looked fine on a local Xcode 26 named bundle and shipped the icon-less system Picker fallback. Root cause: the glass APIs sat behind #if compiler(>=6.2), while every ship lane compiled with Xcode 16.4 — GitHub Actions desktop CI (macos-15, Xcode_16.4.app) and Codemagic omi-desktop-swift-release / omi-desktop-swift-preview (xcode: 16.4) — so the ship toolchain never typechecked the glass code and CI stayed green. Nik reverted the tab bar in #13548; this PR does not re-land it. It makes ship == CI toolchain and fail-closes the gate class that caused the divergence.

The pin

Xcode 26.6, build 17F113 — the newest version+build that exists on both ship surfaces:

Both vendors carry the exact same build, which also matches the local QA toolchain. Never latest/edge.

What changed

  • desktop/macos/ci/xcode-pin.json — the single source of truth for version + build + expected app path (with vendor evidence recorded inline).
  • run-swift-ci.sh reads the pin file (fails closed if missing) and still asserts the exact version+build after selection.
  • desktop-swift-ci.yml: macOS jobs macos-15 → macos-26; cache key prefixes xcode164 → xcode266 (16.4 caches cannot poison 26.x builds); select steps name the pinned version. Ubuntu aggregate jobs untouched.
  • codemagic.yaml: only omi-desktop-swift-release and omi-desktop-swift-preview move to xcode: 26.6. Android 16.4 and iOS 26.0.1 are deliberately untouched. Reviewed codemagic_workflow_contract digests refreshed for this edit (same pattern as Refresh the Codemagic fixture digests broken by the Flutter 3.44.5 bump (unblocks Hygiene on every PR) #11673).
  • test_desktop_swift_ci_contract.py loads the pin file instead of literals, and adds: codemagic pin-agreement (string compare on the two desktop workflows), macos-26 runner assertions, and no-stale-xcode164 assertions.
  • New desktop-compiler-gates manifest check (desktop/macos/scripts/check-desktop-compiler-gates.py): fails on #if compiler(...) / #elseif compiler(...) in Desktop/Sources/Desktop/Tests — the exact shape that hid Liquid Glass from the ship toolchain. Runtime if #available(macOS 26, *) with a working fallback passes. The allowlist is empty and asserted by exact contents, so it cannot silently grow. Registered in .github/checks-manifest.yaml (local + ci lanes) with adversarial fixture coverage (.github/scripts/test_check_desktop_compiler_gates.py).

CI/infra only — no user-visible change; no-changelog-needed (no Sparkle/changelog fragment for a toolchain pin, per desktop changelog rules).

Test plan

  • bash desktop/macos/tests/test-run-swift-ci.sh — pin-driven sandbox; wrong-version, wrong-build, and missing-pin sabotage all fail closed (pin 26.6/17F113).
  • python3 .github/scripts/test_desktop_swift_ci_contract.py — 38 tests OK (workflow + runner + codemagic agree with the pin file).
  • python3 .github/scripts/test_check_desktop_compiler_gates.py — 9 tests OK; planted #if compiler(>=6.2) + glassEffect fixture fails the checker, removing it passes; allowlist exact-contents assertion holds.
  • python3 desktop/macos/scripts/check-desktop-compiler-gates.py — real tree: none found (sources ship zero compiler gates today).
  • python3 .github/scripts/check-release-process-guards.py — exit 0 after the digest refresh.
  • xcrun swift build -c debug --package-path Desktop on Xcode 26.6 (17F113) — Build complete! (1855.82s); no Sendable/deprecation fixes were required for the new toolchain.
  • make preflight local manifest lane — every selected check passes except the pre-existing loaded-host flake test_pr_preflight.py::SingleFlightTests::test_identical_processes_join_and_execute_once, which fails 3/3 on pristine origin/main at the same host load (passes in isolation) and is unrelated to this diff. CI runs it on dedicated runners.
  • Live gh pr checks: all green — Desktop Swift Static & Test Contracts pass 33m29s on macos-26 (run 34691936150; the cold first run needed the raised 90-min ceiling, warm runs fit comfortably), required aggregate Desktop Swift Build & Tests pass, PR Metadata Preflight pass.

@Git-on-my-level Git-on-my-level added the no-changelog-needed Skip desktop changelog enforcement for internal-only changes label Sep 12, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 12 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Git-on-my-level added a commit that referenced this pull request Sep 12, 2026
…full lane

Measured on run 34687313733 (PR #13564): with the pin moved to Xcode 26.6,
every cache cold under the new xcode266 keys, the full Swift suite ran
past 55 minutes and the 60-minute job ceiling cancelled the job mid
serial-cluster. Every completed suite was green (one wedged batch cost
1650s before its 1500s watchdog bisected it cleanly; zero test failures)
— purely a timing ceiling, so:

- desktop-swift-verify timeout-minutes 60 -> 90
- full-lane OMI_SWIFT_TEST_STEP_BUDGET_SECONDS 2700 -> 4200

Both changes cite the run; contract test constants updated to match.
PR #12867 looked right on a local Xcode 26 named bundle and shipped the
icon-less system Picker fallback: Liquid Glass sat behind
#if compiler(>=6.2) while desktop CI (GHA desktop-swift-ci.yml and Codemagic
omi-desktop-swift-release/-preview) compiled with Xcode 16.4, so the ship
toolchain never typechecked the glass APIs (#13548 reverted the tab bar).
Bump the desktop ship/CI toolchain off 16.4 and make drift impossible:

- desktop/macos/ci/xcode-pin.json is now the only place the version (26.6),
  build (17F113), and expected app path (/Applications/Xcode_26.6.app) live.
  26.6/17F113 exists on both vendors: GHA macos-26 image 20260907.0351.1
  (default Xcode, /Applications/Xcode_26.6.app) and Codemagic mac_mini_m4
  image 'Xcode 26.6.x (default)' (/Applications/Xcode-26.6.app).
- run-swift-ci.sh reads the pin file (fails closed when it is missing) and
  keeps asserting the exact version+build after selection.
- desktop-swift-ci.yml macOS jobs move macos-15 -> macos-26, cache key
  prefixes move xcode164 -> xcode266 so 16.4 caches cannot poison 26.x
  builds, and the select steps name the pinned version.
- codemagic.yaml omi-desktop-swift-release/-preview move xcode: 16.4 ->
  26.6 (Android 16.4 and iOS 26.0.1 untouched); the reviewed
  codemagic_workflow_contract digests are refreshed for that edit.
- test_desktop_swift_ci_contract.py loads the pin file instead of literals
  and adds codemagic pin-agreement + macos-26 runner assertions.

Verified locally: bash desktop/macos/tests/test-run-swift-ci.sh (pin
26.6/17F113 sandbox incl. wrong-version/wrong-build/missing-pin sabotage);
python3 .github/scripts/test_desktop_swift_ci_contract.py (38 tests OK);
python3 .github/scripts/check-release-process-guards.py (exit 0);
xcrun swift build -c debug --package-path Desktop on Xcode 26.6 (17F113)
completes (1855s).
New desktop-compiler-gates manifest check: desktop/macos/scripts/
check-desktop-compiler-gates.py fails when Desktop/Sources or Desktop/Tests
contain #if compiler(...) / #elseif compiler(...) — the shape that let
#12867 compile Liquid Glass out of the Xcode 16.4 ship toolchain while CI
stayed green (#13548 reverted the tab bar). Runtime availability gating
(if #available(macOS 26, *) with a working fallback) is the sanctioned
pattern and passes. The allowlist ships empty and is asserted by exact
contents in test_check_desktop_compiler_gates.py, so it cannot silently
grow; entries require a documented reason and a matching path+line.

checks-manifest.yaml also extends desktop-swift-ci-contract triggers with
the pin file, runner script, launcher test, and codemagic.yaml so every
pin consumer re-runs the contract test on drift.

Verified locally: python3 .github/scripts/test_check_desktop_compiler_gates.py
(9 tests OK — planted #if compiler(>=6.2) glassEffect sabotage fails the
checker and removing it passes); python3 desktop/macos/scripts/
check-desktop-compiler-gates.py on the real tree reports none found;
make preflight manifest lane: all selected checks pass except the
pre-existing loaded-host flake in test_pr_preflight.py
SingleFlightTests.test_identical_processes_join_and_execute_once, which
fails 3/3 on pristine origin/main at the same host load (passes in
isolation) and is unrelated to this diff.
The desktop changelog check requires an in-repo fragment for production
desktop paths even with the no-changelog-needed label: the label is
invisible after merge and would redden main's Release Eligibility run.
This PR is CI/infra only (toolchain pin + fail-closed gate), so the
marker is kind: none.
…full lane

Measured on run 34687313733 (PR #13564): with the pin moved to Xcode 26.6,
every cache cold under the new xcode266 keys, the full Swift suite ran
past 55 minutes and the 60-minute job ceiling cancelled the job mid
serial-cluster. Every completed suite was green (one wedged batch cost
1650s before its 1500s watchdog bisected it cleanly; zero test failures)
— purely a timing ceiling, so:

- desktop-swift-verify timeout-minutes 60 -> 90
- full-lane OMI_SWIFT_TEST_STEP_BUDGET_SECONDS 2700 -> 4200

Both changes cite the run; contract test constants updated to match.
Match compiler() anywhere in #if/#elseif, ignore block-commented
directives, and fail closed when the scan root has no Swift files.
#13570 added dueStartDate/dueEndDate to ActionItemsFetcher on main.
GitHub analyzes the merge of this PR, so the existing test stubs must
accept those named args or Dart Analyze fails.
@Git-on-my-level
Git-on-my-level force-pushed the ci/desktop-ship-xcode-pin branch from fd3238b to 8be3ef9 Compare September 12, 2026 23:05
CI Check Dart formatting uses --line-length 120 after pub get.
…-pin

# Conflicts:
#	.github/checks-manifest.yaml
#	.github/scripts/test_desktop_swift_ci_contract.py
#	.github/workflows/desktop-swift-ci.yml
#	desktop/macos/scripts/run-swift-ci.sh
@Git-on-my-level
Git-on-my-level merged commit 6eb47ae into main Sep 13, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog-needed Skip desktop changelog enforcement for internal-only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant