build: share compiler cache across ephemeral worktrees - #7048
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds an opt-in Cargo wrapper that configures ChangesCompiler cache workflow
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/cargo_cached.sh`:
- Line 15: Update the cache-directory initialization around SCCACHE_DIR to
validate that HOME is set when neither SCCACHE_DIR nor XDG_CACHE_HOME provides a
location. Before deriving the default path, emit a clear wrapper-specific error
and exit cleanly if HOME is unavailable; preserve the existing override
precedence and default external cache location.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: bb6ae9a8-ed03-448a-9e27-5999de737049
📒 Files selected for processing (4)
changelog.d/7048-cargo-cache.mddocs/src/contributing/building.mdscripts/cargo_cached.shtests/test_cargo_cached.sh
Closes #7047
Summary
Why
Short-lived worktrees lose local
target/reuse and repeatedly compile unchanged Rust inputs. A repository-wide wrapper or sharedCARGO_TARGET_DIRwould impose policy on every contributor and risk Perry's per-crate feature/link isolation, so this change provides only an explicit wrapper.Changes
scripts/cargo_cached.shtests/test_cargo_cached.shdocs/src/contributing/building.mdValidation
shellcheck scripts/cargo_cached.sh tests/test_cargo_cached.shbash -n scripts/cargo_cached.sh tests/test_cargo_cached.sh./tests/test_cargo_cached.shgit diff --check origin/main...HEADcargo check -p perrybenchmark with a clean temporary target and cacheThe warm run served 400/400 cacheable compiler requests from cache (338 Rust, 49 C/C++, 13 assembler), with zero misses. Results are environment-specific and are not presented as a fixed speedup.
./scripts/pre-tag-check.sh --quickwas also run. Its change-focused checks pass; it reports existingorigin/mainbaseline drift in workspace architecture, benchmark freshness, file-size, GC-store, and address-classification audits. This PR does not touch any reported file or baseline.Checklist
Summary by CodeRabbit
sccachefor faster builds in ephemeral worktrees.