ci: build cmuxTests without the compilation cache so it rebuilds incrementally
A PR admission recompiled every cmuxTests file (about 1,100) even when the change touched one test file: 139 s of cmuxTests on 12vcpu, 1,355 CPU s. cmuxTests now builds without the compilation cache, so swift-driver's incremental build decides what to recompile. The app and every package keep the cache and their exact compiler arguments.
Why the cache defeats incremental builds here
With -driver-show-incremental on the cached build, all 1,073 inputs are Invalidated externally by Newer: cmuxTests-…-ChainedBridgingHeader.h. Under the cache the driver chains the app's cmux-Bridging-Header.h, which cmuxTests reaches through @testable import cmux_DEV, into a generated header and rewrites it on every build. cmuxTests has no bridging header of its own, so there is nothing in the project to change. COMPILATION_CACHE_ENABLE_CACHING=$(CMUX_CI_COMPILATION_CACHE_$(TARGET_NAME):default=YES) is evaluated per target, so only cmuxTests opts out.
Measurements
Canary #14249, run 36081880621, blacksmith-12vcpu-macos-26, Xcode 26.6. Each row is a cmux-unit rebuild after the one before, on the admission's DerivedData.
| Edit | cmuxTests, cache on | cmuxTests, cache off for cmuxTests only | total rebuild, off |
|---|---|---|---|
| app function body only | 1 s, 0 files | 1 s, 0 files | 49 s |
| one test file body | 139 s, all files (1,355 CPU s) | 31 s, 1 task | 44 s |
| signature change inside an existing extension | all files (round 1, 6vcpu) | 30 s, 0 files | 66 s |
new top-level private func in an app file | 135 s, all files | 117 s, all files | 164 s |
new top-level extension on Workspace | all files (round 1) | 110 s, all files | 234 s |
The app target stays incremental with the per-target setting: the body edit compiled 2 app tasks, the same as with the cache on. Building cmux-numeric-locale and then cmux-unit again was a 13 s no-op, so the scheme order in this script does not reset the build record.
What this does not fix
- Adding or removing any top-level declaration in the app still recompiles all of
cmuxTests, with or without the cache. The driver remarks trace it throughinterface of source file from cmux_DEVto types every test file uses (NSObject,String), because the imported module's top-level names carry no per-declaration fingerprints. On 100 six-commit windows of main, 27 added or removed a top-level app declaration. - What's left of a small rebuild is mostly
cmuxTests' own emit-module (26 s of the 31 s). Xcode 26 has no setting that skips module emission for a test bundle. - Splitting
cmuxTestsinto per-area bundles would not help with app edits. The invalidation covers the whole module, and 915 of 1,068 test files importcmux_DEV. - On the macOS 15 pool (Xcode 26.3) the app itself recompiled all 5,218 files on a body-only edit under the cache (run 36035657899). That is separate from this change.
The first admissions after this lands rebuild cmuxTests once, because its arguments differ from the current seeds. The seeds pick up the new arguments from the next seed build, since seed-derived-data.yml builds through this script.
Validation
tests/test_ci_test_compilation_cache_seed.sh passes with the new arguments. The measurements above come from the canary. This PR's own admission shows the setting in real CI.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Builds cmuxTests without the compilation cache so edits recompile only what changed instead of all ~1,100 test files. A one-test-file edit dropped from 139 s (1,355 CPU s, all files) to 31 s (one task). The app and every package keep the cache; the setting is evaluated per target, so this only affects cmuxTests.
Under the cache, the driver regenerates cmuxTests' chained bridging header (the app's header reached through @testable import) on every build, which invalidates every input. Without the cache, swift-driver's incremental build works normally.
What this does not fix
- Adding or removing a top-level declaration in the app still recompiles all of
cmuxTests, with or without the cache. - The first admissions after this lands rebuild
cmuxTestsonce because its build arguments change.
Summary by CodeRabbit
- Chores
- Updated build configuration to keep compilation caching enabled by default while disabling it for the
cmuxTeststarget. This adjustment applies to the CI build process; no changes to app features or behavior are included.
- Updated build configuration to keep compilation caching enabled by default while disabling it for the