You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Set up sccache as a shared Rust compiler cache during bun install #3087
Every worktree builds Rust from cold into its own target/ (2.5–23 GB each), and there is no compiler cache shared between them. A new worktree pays a full cold build — minutes of the pre-push gate — on its first push. The same happens on each dev machine.
Solution
Set up sccache as the machine-wide Rust compiler cache as part of bun install (root prepare lifecycle), so every dev machine gets it without a manual step:
scripts/setup-build-cache.ts, run from the root prepare script
Install a pinned sccache release into ~/.cargo/bin (SHA-256 pinned in the script) when it is missing
Configure ~/.cargo/config.toml (build.rustc-wrapper = "sccache", CMake compiler launchers for llama.cpp) — merge only when safe, otherwise print the lines to add
Set a 40 GiB local disk cache
Near-zero-cost no-op when already configured; never fails bun install (offline, unsupported platform, no cargo); opt-out via NODESPACE_SKIP_BUILD_CACHE=1
Local cache per machine, not a shared remote cache: cross-machine hits need identical rustc and absolute paths, and the per-machine win (many worktrees sharing one cache) captures most of the benefit.
Acceptance criteria
bun install on a machine without sccache installs and configures it
bun install on a configured machine is a fast no-op (no network)
An existing ~/.cargo/config.toml is never clobbered
Failure to set up never fails bun install
Unit tests (DOM-free, under scripts/) for the config-merge decisions
Activity
malibio commentedon Sep 26, 2026
Frontend: 5406 passed; scripts: 587 passed