Repository navigation
ci: build E2E products against the nightly compilation-cache seed - #14015
teamleaderleo wants to merge 1 commit into
Conversation
The E2E build job kept its own e2e-compilation-v1 cache, keyed on the absolute workspace path. Across 19 builds it cost about 82 s median to restore and did not make builds faster, and its key could never match the xcode-compilation-test seed nightly.yml writes for compile admission. The build job now resolves, keys and compiles through the canonical entry points compile admission uses, at the same DerivedData and CAS paths, and restores that seed read-only through cache-restore (R2 by default). Its own save, bound, discard and main-containment steps are gone, along with scripts/ci/revision_on_main.py, which only gated them. The Swift package cache becomes read-only too, since resolution now runs in the canonical copy. The default runner pins CMUX_CI_XCODE_APP to CMUX_CI_XCODE_APP_PR, as the seeder and PR admission do, so image-default drift cannot split the key. An explicit inputs.runner stays unpinned. A fresh product is stamped at the canonical checkout, then relocated into the workspace, before the usual stamp and seal. Refs #13663 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 26 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
All contributors have signed the CLA ✍️ ✅ |
|
Measured on dispatch 35933554831 from this branch, testing main
The seed and this build are 17 commits and 55 files under Until that is measured, don't merge this PR expecting a speedup. What it does prove today is a restore that costs 22 s instead of about 82 s, with fewer E2E-specific cache steps. — Nyan g1 🗝️ |
|
Root cause of the missing speedup, from Xcode's own
Between the seed (
So the compile cache cannot be what makes these builds fast. The approaches that fit this code shape are:
This PR is still correct and simpler than E2E's old cache: it matches the shared key and restores in 22 s instead of about 82 s. But it cannot deliver a build-time win on its own. Merge it for the simplification, not for speed. — Nyan g1 🗝️ |
|
Closing: this PR's own 09-24 measurement found 3 cache hits and 2,662 misses on the app target, and the build was no faster. #14161 stopped restoring that cache in compile admission for the same reason: Swift keys compile jobs on the whole module. |
Re-running one E2E test pays a full cold Debug build (#13663). The build job's own
e2e-compilation-v1cache cost about 82 s median to restore across 19 builds and did not make them faster. It could never help: its key hashed the absolute$GITHUB_WORKSPACEpath, so it could not share thexcode-compilation-test-*seed thatnightly.ymlrefresh-test-compilation-cachewrites and PR compile admission reads.The E2E
buildjob now compiles the way compile admission does:$CMUX_CI_CANONICAL_ROOT/derived-data-compile-admissionand the CAS is.../compile-admission-cas. The seed's key hashes the DerivedData basename, so it has to be the same name.canonical-resolve,canonical-fingerprintandcanonical-buildinscripts/ci/compile-app-host-test-product.sh. The key hashes onlyxcodebuild -versionand that basename../.github/actions/cache-restorewith backendvars.CI_CACHE_BACKEND || 'r2', using admission'sxcode-compilation-test-<os>-<arch>-<fingerprint>-prefix. R2 reads need onlyCI_CACHE_R2_PUBLIC_URL, now set at workflow level. E2E's save, bound, discard and main-containment steps are removed, and so isscripts/ci/revision_on_main.py, which only gated them. The Swift package cache is restore-only as well: resolution now happens in the canonical copy, so saving from the workspace would store an empty directory.CMUX_CI_XCODE_APPisvars.CMUX_CI_XCODE_APP_PRwheninputs.runnerisauto, which matches the seeder and PR admission, so image-default drift cannot split the key again. With an explicitinputs.runnerthe job stays unpinned, because a pinned Xcode missing from that image hard-failsscripts/select-ci-xcode.sh. That case falls back to a cold build instead. The stale env comment now explains this.$CMUX_CI_CANONICAL_ROOT/src, relocates into the workspace, then stamps and seals as before, the same sequence asci-macos.yml. An adopted product skips the first stamp. The test job already aliases the canonical source throughrestore-app-host-test-product.sh.srcin place: the next canonical resolve replaces it withrsync --delete.Tradeoff. This gives up per-run, workspace-scoped DerivedData. The canonical root is shared per machine, so on a persistent host this job and compile admission use the same two paths. Each clears them on start. On ephemeral Blacksmith VMs and Tart VMs, one machine means one job.
The packaging change sits above the
tarline that #14007 edits.git merge-treeagainstci/e2e-reuse-parallel-downloadis clean, and the tests below pass on that merge.Validation (local, Linux)
tests/test_ci_e2e_compilation_cache.pynow pins the new design and passes (18 tests). The tests run the real prepare, package and cleanup step scripts and the realcanonical-fingerprint. They check that the fingerprint does not depend on the workspace and changes with the Xcode version or the basename; that the paths, restore key and Xcode source match admission and the seeder; that nothing in the workflow saves a cache; the stamp order for fresh and adopted products; and that cleanup refuses unowned paths and keepssrc. Mutating the basename, the Xcode variable, the canonical stamp orcanonical-buildin the workflow each makes it fail.grep -rln test-e2e.yml testspasses:test_run_e2e.py,test_ci_e2e_compilation_cache.py,test_ci_self_hosted_guard.sh(its E2E allowlist loses the cache steps),test_ci_app_host_home_isolation.py,test_ci_reusable_workflow_permissions.py,test_ci_app_host_pipe_capture.py,test_reuse_app_host_products.py(68 tests) andtest_ci_change_areas.py.runsteps ofci-guards.ymlworkflow-guard-tests, across every matrix group, pass. Four needed their CI context:RUNNER_TEMPfor the guard profile and the venv setup,working-directory: agent-chatfor the bun test, andpython3.9for the prune check.actionlintv1.7.12 ontest-e2e.ymlis clean.None of this runs macOS or shows a cache hit. The real proof is an E2E dispatch after the seed run 35884626006 lands (still queued when this PR opened). That run should show
r2-cache: restored xcode-compilation-test-...in "Restore test compilation cache" and a shorter "Compiled from source in N s" than the cold baseline. One thing only that run can confirm: the seeder runs on theMACOS_RUNNER_PRpool and E2E onMACOS_RUNNER_TESTS. Their Xcode and paths now match, but whether the compiler entries hit across the two host images has not been measured.Refs #13663
— Nyan g1 🗝️
Run: run_cmux_main_red_suite_slices_and_errno_fixes_20260923_8053081a
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Reworks the E2E build job to compile against the nightly
xcode-compilation-testseed that PR compile admission restores, replacing its owne2e-compilation-v1cache, which never hit because its key hashed the absolute workspace path. The job now resolves, fingerprints and builds through the same canonical entry points at the same DerivedData and CAS paths, and restores the seed read-only viacache-restore.Changes
scripts/ci/revision_on_main.py, which only gated them.CMUX_CI_XCODE_APPtovars.CMUX_CI_XCODE_APP_PRto match the seeder; an explicitinputs.runnerstays unpinned and falls back to a cold build.Refs #13663
Written for commit 445a6ca. Summary will update on new commits.