Skip to content

iPhone CI: build for any simulator while a fresh one boots - #415

Merged
alexkroman merged 3 commits into
mainfrom
claude/sim-boot-overlap
Nov 25, 2026
Merged

alexkroman merged 3 commits into
mainfrom
claude/sim-boot-overlap

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

What & why

Every iPhone job loses minutes to its simulator's first boot. #405 started the boot in the background while the build runs. A probe across six runners showed why that didn't save much:

Simulator Ready
The runner image's own 250 s / 138 s
The image's own, erased first 179 s / 208 s
Freshly created 148 s / 158 s

Two changes:

  1. Build for any simulator. ios-test.sh and ios-uitest.sh build with -destination 'generic/platform=iOS Simulator' ARCHS=arm64 (IOS_SIM_BUILD in ios-lib.sh), so the build never names the booting device. test-without-building then runs on it. ARCHS=arm64 because a generic destination otherwise builds every simulator architecture. ios-check.sh's probe build uses the same destination and settings, so it still reuses that build, and it no longer needs a simulator.
  2. A fresh simulator on CI. BLURT_SIM_FRESH=1, set by check.yml's ios-build, ios-audits and ios-sanitizers, makes ios_require_device create a new simulator with the picked one's device type and runtime. It's off by default, so a Mac doesn't collect a simulator per run.

Expected

About 2 minutes off each iPhone job, if the boot now overlaps the build, plus whatever a fresh simulator saves on a slow runner. The iPhone jobs (ios-audits, ios-build) are the slowest in check, so this should shorten the whole run.

Risk

The main question is whether test-without-building on the named device accepts what the generic arm64 build produced. This PR's CI answers it. Draft until that run is green and its timings are compared with #405's.

How it was tested

  • scripts/check.sh --portable passes.

  • ios_require_device with BLURT_SIM_FRESH on and off, checked against a stub xcrun.

  • xcodebuild and simulator behaviour: this PR's CI.

  • scripts/check.sh passes (or CI will, if I'm not on a Mac)

  • I read AGENTS.md and this doesn't reintroduce anything deliberately removed

  • Docs updated if behavior changed


Generated by Claude Code

A probe of the CI simulator's boot (six runners) found every first boot
migrates data for 1.5–2 minutes, whatever the simulator, and that
xcodebuild resolving the named device stalls while it boots: on #405's
runs package resolution took 3.3 minutes beside a boot against ~1 alone,
so the build waited on the boot it was meant to overlap.

- The tests are built for generic/platform=iOS Simulator with
  ARCHS=arm64 (IOS_SIM_BUILD in ios-lib.sh) and run on the named device by
  test-without-building, in ios-test.sh and ios-uitest.sh. The probe build
  in ios-check.sh uses the same, so it still reuses that build and no
  longer needs a simulator picked.
- BLURT_SIM_FRESH=1, set by check.yml's ios-build, ios-audits and
  ios-sanitizers, runs on a newly created simulator of the picked one's
  type and runtime: ready (boot plus first app launch) in 148–158 s in the
  probe, against 138–250 s for the runner image's own. Off by default, so
  a Mac doesn't collect a simulator per run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
check.sh's drift check failed on #415 (App/Blurt unchanged; the same
check passed on two other PRs two minutes earlier) with nothing but
"out of sync". It now prints the XcodeGen version CI installed —
Homebrew's current, unpinned — and the regenerated project's diff, so
the next drift names its own cause.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5

Copy link
Copy Markdown
Collaborator Author

Results from the first run, on 432590c:

Job #405 This PR
ios-audits a 22.5 min 16.3 min
ios-sanitizers (address) 16.6 min 11.4 min
ios-sanitizers (thread) 14.1 min 11.8 min
ios-build 12.7 min 17.8 min

On ios-build, package resolution still took about 2 min while the simulator booted, and the test run took about 6.

That run's macos job failed only the Mac project drift check. This PR doesn't touch App/Blurt, and the same check passed on #410 and #411 two minutes earlier. 32dfe2f makes that check print the XcodeGen version and the diff of the regenerated project, so a repeat will name its cause. It also merges main.


Generated by Claude Code

@alexkroman
alexkroman marked this pull request as ready for review November 25, 2026 19:19
@alexkroman
alexkroman added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 8816cbe Nov 25, 2026
21 checks passed
@alexkroman
alexkroman deleted the claude/sim-boot-overlap branch November 25, 2026 20:01
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.

2 participants