feat(ci): add sccache compilation caching with graceful fallback#324
Merged
DorianZheng merged 1 commit intomainfrom Mar 2, 2026
Merged
feat(ci): add sccache compilation caching with graceful fallback#324DorianZheng merged 1 commit intomainfrom
DorianZheng merged 1 commit intomainfrom
Conversation
Add sccache (per-compilation-unit caching via GHA cache API) to all
Linux Docker builds, replacing the less effective actions/cache for
cargo registry. sccache works inside manylinux containers and shares
cache across build-runtime, build-node, and build-wheels workflows.
Key changes:
- New warm-caches.yml workflow (Bevy pattern) to pre-warm sccache on
push to main and weekly cron
- Replace actions/cache with sccache in build-runtime and build-node
- Add sccache to build-wheels via cibuildwheel environment-pass
- Three-layer fallback ensures sccache failure never breaks builds:
1. continue-on-error on sccache setup steps
2. Conditional Docker mount (only if sccache binary exists on host)
3. Container-level RUSTC_WRAPPER check + pass-through shim for
cibuildwheel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
actions/cachefor manylinux cargo registry with sccache (which caches compilation units, not just the registry)continue-on-erroron sccache setup stepsRUSTC_WRAPPERcheck + pass-through shim for cibuildwheelMotivation
Three workflows independently compile the same Rust code inside manylinux Docker containers (~17-25 min each). Current caching (Swatinem + actions/cache) only caches the cargo registry — zero compilation caching inside Docker. sccache works inside containers via the GHA cache API and shares cache across all workflows.
Files Changed
.github/workflows/warm-caches.yml.github/workflows/build-runtime.yml.github/workflows/build-node.yml.github/workflows/build-wheels.ymlsdks/python/pyproject.tomlTest plan
Warm Cachesvia workflow_dispatch — verify cold cache (all misses insccache --show-stats)Warm Cachesagain — verify warm cache (90%+ hits)Build Runtime— verify sccache hits in Docker build, macOS unaffectedBuild Node.js— verify sccache hits in Docker buildBuild Wheels— verify sccache hits in cibuildwheel container