This is a Vercel-maintained fork of mozilla/sccache. It is maintained as a stack of patches managed with Graphite, each branch containing a single feature/fix on top of the upstream branch.
For full upstream documentation, see the upstream README or the upstream repository.
upstream— Tracksmozilla/sccachemain. This is the base of the stack.vercel/ci-fixes— Bottom of the stack (CI cleanup).vercel/multilevel-cachingthroughvercel/fork-readme-ci— Stacked feature branches.main— Always points to the top of the stack (same commit as the topmost branch).
Each patch is a single Graphite branch with one commit. The stack order (bottom to top):
-
CI fixes (
vercel/ci-fixes) — Removes coverage, benchmarks, snap, FreeBSD, integration-tests, and unsupported cross-compilation targets from upstream CI. -
Crate type allow hash (
vercel/crate-type-allow-hash) — WhenSCCACHE_RUST_CRATE_TYPE_ALLOW_HASHis set, all crate types become cacheable. The env var value is hashed into the cache key only when unsupported crate types are present. -
Rust basedirs (
vercel/rust-basedirs) — StripsSCCACHE_BASEDIRprefixes from the Rust hash key so cache entries are portable across machines with different checkout paths. -
OpenDAL upgrade + Vercel Artifacts backend (
vercel/opendal-upgrade-artifacts) — Upgrades opendal via[patch.crates-io](apache/opendal#7334). Adds Vercel Artifacts cache backend withSCCACHE_VERCEL_ARTIFACTS_TOKEN,_ENDPOINT,_TEAM_ID,_TEAM_SLUG. -
Reflink-based disk cache (
vercel/file-clone-reflink) — Cherry-picked from upstream mozilla/sccache#2640.SCCACHE_FILE_CLONE=truestores entries uncompressed and restores via filesystem reflinks. Drop once merged upstream. -
File-clone post-write compression (
vercel/file-clone-compress) — AddsSCCACHE_FILE_CLONE_COMPRESSto compress reflink entries after write. -
Directory dep-info hashing (
vercel/fix-dir-dep-info) — Fixes mozilla/sccache#2653. Handles directories in rustc dep-info by recursively hashing contents. -
This README + CI/release workflows + version suffix (
vercel/fork-readme-ci) — Fork documentation,vercel-ci.yml,vercel-release.yml, and-vercelsuffix onsccache --version.
Previously the stack included a Multi-level caching patch cherry-picked from mozilla/sccache#2581; that PR landed upstream (merge commit d11e2e0) so the fork-specific patch has been dropped.
This fork uses Graphite to manage the patch stack. Install with npm i -g @withgraphite/graphite-cli.
gt loggt checkout vercel/<branch-to-edit>
# make changes
git add -A && git commit --amend --no-edit
gt restack # rebase all branches above
git checkout vercel/fork-readme-ci # go to top
git branch -f main HEAD # point main at top of stack
git push --force-with-lease origin main vercel/<changed-branch> [other affected branches...]gt checkout vercel/<branch-below> # check out where to insert
gt create vercel/<new-branch> -m "commit message"
# make changes
git add -A && git commit -m "description"
gt restack # rebase everything above
git checkout vercel/fork-readme-ci
git branch -f main HEAD
git push --force-with-lease origin main vercel/<new-branch> [restacked branches...]Then create a PR:
gh pr create --base vercel/<branch-below> --head vercel/<new-branch> --title "[N/M] description"And update the base of the PR that was previously on top of <branch-below>:
gh pr edit <pr-number> --base vercel/<new-branch>If an upstream PR (e.g., #2581) gets merged:
gt checkout vercel/<branch-to-drop>
gt move --onto upstream # or onto the branch below it
# if the branch is now empty, delete it
gt restack
git checkout vercel/fork-readme-ci
git branch -f main HEADgit fetch upstream
git checkout upstream
git reset --hard upstream/main # update the upstream branch
git push --force-with-lease origin upstream
gt restack # rebase entire stack
git checkout vercel/fork-readme-ci
git branch -f main HEAD # point main at top
git push --force-with-lease origin --allAlways finish with:
git checkout vercel/fork-readme-ci # top of stack
git branch -f main HEAD # sync main
git push --force-with-lease origin main [affected branches...]vercel-ci.yml— Runscargo teston Ubuntu and acargo build --releasesmoke-check forx86_64-pc-windows-msvcon every push/PR. The Windows job installs Strawberry Perl viashogo82148/actions-setup-perlsoopenssl-src's Perl build script can run.vercel-release.yml— Manual trigger (workflow_dispatch) with an optionalversioninput (defaults to1.0.YYYYMMDD). BumpsCargo.tomlon a throwaway commit, pushes tagv<version>(not back tomain), creates an empty GitHub release, then builds release binaries forx86_64/aarch64Linux musl,x86_64/aarch64macOS, andx86_64Windows. The build matrix is generated viammastrac/mmm-matrix. Assets are namedsccache-<target>.tar.gz(.zipon Windows) and are consumable bycargo binstall.
Once a release exists, install the latest prebuilt binary with:
cargo binstall --git https://github.com/vercel/sccache sccacheCargo.toml ships [package.metadata.binstall] pointing at https://github.com/vercel/sccache/releases/latest/download/sccache-<target>.{tar.gz,zip}, so the command above always pulls the most recent release regardless of the version field in Cargo.toml (which tracks upstream and does not get bumped per release).
After modifying the stack, verify with:
cargo fmt --all
cargo clippy --locked --all-targets -- -D warnings -A unknown-lints -A clippy::type_complexity -A clippy::new-without-default
cargo build
cargo testGenerate a per-file diff manifest:
for commit in $(git log --reverse --format="%H" upstream..HEAD); do
echo "### $(git log --oneline -1 $commit)"
git diff-tree --no-commit-id --name-status -r $commit
echo
done