docs(dev): recommend sccache as cargo's wrapper, one compile cache for every checkout and workspace #2575
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2575
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:build/sccache-dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Every new checkout or jj workspace builds all of its crates.io dependencies cold, which takes many minutes and tens of
GB on a PC where several workspaces build at once.
docs/dev/setup.mdgets a "The compile cache" section recommendingsccache as cargo's wrapper for anyone who builds in more than one tree: installed
once per user (
mise use -g aqua:mozilla/[email protected]) and turned on in the shell's profile (RUSTC_WRAPPER=sccache,a 40 GB cache). It is deliberately not in
mise.toml, so CI, the tests that run mise in a copy of the tree, andcheckouts without sccache are unchanged (a first version that made it mise's default failed CI's run_all part 1).
The section also says why two trees must never share one
CARGO_TARGET_DIR: cargo names a path crate relative to itsworkspace, so one tree's build can pass for another's (an agent's check once passed on code it never read).
Read:
docs/dev/setup.md, "The compile cache".Testing
Tested: Linux, this PC: the recommended settings (sccache 0.19.0,
RUSTC_WRAPPER=sccache) have been used for the#2434 helpers' cargo builds, where crates.io dependencies hit across workspaces and the repository's own crates compile
per workspace. A docs-only change: no game, build or check behaviour changes.
Still to test:
Measurements
Nothing to measure: documentation only.
Risks
None for players or CI: a recommendation in the setup guide, nothing in the build.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (CI runs it on this head.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Possibly related, for context:
00a61f476b86e18a9079Reworked after CI's run_all part 1 failed: sccache is now a recommendation in setup.md, not mise's default, so CI and mise-in-a-copy tests are unchanged. Docs only; head
86e18a90.WIP: build(dev): cargo shares one sccache across checkouts and workspacesto WIP: docs(dev): recommend sccache as cargo's wrapper, one compile cache for every checkout and workspaceRebased onto main
8bd104aa(the CI rework, #2568; it touches no file of this PR) to rerun CI: the last run's 4 failures each stopped after 1 s, before any step ran.86e18a90793101ef5938WIP: docs(dev): recommend sccache as cargo's wrapper, one compile cache for every checkout and workspaceto docs(dev): recommend sccache as cargo's wrapper, one compile cache for every checkout and workspace