Skip to content
Documentation

Docs / Adapter commands / sccache

sccache adapter

Keep sccache in charge of compiler keys and reuse. The adapter supplies its remote endpoint, starts and stops the daemon, controls writes, and records native statistics.

Command
boringcache sccache
Protocol
sccache WebDAV-style cache paths
Action
mode: sccache

How the adapter works

Compiler outputs stay compiler-native

sccache still decides cacheability for Rust, C, and C++ compilation.

Shared beyond one checkout

Reuse compiler outputs across CI jobs and local development when paths and inputs line up.

Token-scoped writes

Restore broadly, publish narrowly, and avoid giving every job write access.

Set up sccache

Keep the command and cache tag in .boringcache.toml, then use the same boringcache sccache entrypoint locally and in CI.

[adapters.sccache]
tag = "compiler-cache"
command = ["cargo", "build", "--release"]

# Run: boringcache sccache

Before the first run

  • Use sccache 0.16.0 or newer; install it before the BoringCache Action.
  • Leave sccache-key-prefix unset unless the repository needs a stable WebDAV sub-root.
  • Keep Cargo incremental state disabled while sccache handles compiler reuse.

Use the same adapter in GitHub Actions

The Action starts sccache with the shared remote store, exports compiler-wrapper settings, and stops the daemon after later workflow steps.

.github/workflows/ci.yml
- uses: boringcache/one@1781572d7b3ec5aef652f8ba479b981439b2776b # v1.48.2
  with:
    trust-policy: auto
    mode: sccache

- run: cargo build --release

Approve the repository through Connect CI and grant the job contents: read and id-token: write. The Action uses that Machine connection. Pull requests restore by default; trusted jobs may publish. See the authentication example in the GitHub Actions reference for scoped credentials when OIDC is unavailable.

GitHub Actions reference

Benchmarks

Deno, Zed, Zed on Namespace runners, and Zed release bundle build the same upstream commits with BoringCache, Depot Cache, GHA Cache, kache, GHA Cache + target, mr-boxington and Depot runner cache on the same runner classes.

Deno

Rust

Benchmark →

JavaScript and TypeScript runtime written in Rust.

Average restore, build and save · lower is better

GitHub runner

4 vCPU · 16 GB · Ubuntu 24.04 x86-64

Base · sccache compiler cache

BoringCache
26 min 0 s 8 builds
Depot Cache
29 min 25 s 8 builds
GHA Cache
29 min 0 s 8 builds
kache
26 min 6 s 8 builds

Plus · sccache, Cargo registry and target directory

BoringCache +
22 min 0 s 8 builds
GHA Cache + target
25 min 13 s 8 builds
mr-boxington
33 min 4 s 8 builds
Same CPU model

Builds of one commit can land on different CPU models. These ratios use only the build pairs where both caches ran on the same model; above 1.00× means BoringCache's total time over those pairs was lower.

Depot Cache vs BoringCache
1.13× · 2 of 8
GHA Cache vs BoringCache
1.04× · 1 of 8
kache vs BoringCache
1.13× · 2 of 8
GHA Cache + target vs BoringCache +
1.09× · 1 of 8
mr-boxington vs BoringCache +
1.51× · 2 of 8
5 CPU models recorded
BoringCache · sccache compiler cache
AMD EPYC 9V74 (4 builds) · AMD EPYC 9V45 (2 builds) · AMD EPYC 7763 (1 build) · Intel Xeon Platinum 8370C (1 build)
BoringCache + · sccache, Cargo registry and target directory
AMD EPYC 7763 (5 builds) · AMD EPYC 9V74 (3 builds)
Depot Cache · sccache WebDAV backend
AMD EPYC 9V74 (4 builds) · AMD EPYC 7763 (2 builds) · Intel Xeon Platinum 8573C (1 build) · AMD EPYC 9V45 (1 build)
GHA Cache · sccache GitHub Actions backend
AMD EPYC 7763 (3 builds) · Intel Xeon Platinum 8573C (2 builds) · AMD EPYC 9V74 (2 builds) · AMD EPYC 9V45 (1 build)
kache
AMD EPYC 9V45 (3 builds) · AMD EPYC 7763 (2 builds) · AMD EPYC 9V74 (2 builds) · Intel Xeon Platinum 8573C (1 build)
GHA Cache + target · sccache plus actions/cache for registry and target
AMD EPYC 9V74 (3 builds) · AMD EPYC 9V45 (2 builds) · AMD EPYC 7763 (2 builds) · Intel Xeon Platinum 8573C (1 build)
mr-boxington
AMD EPYC 7763 (4 builds) · Intel Xeon Platinum 8573C (2 builds) · AMD EPYC 9V45 (1 build) · Intel Xeon Platinum 8370C (1 build)
Cold and warm builds

Each table is one workflow run with one build per cache. A row marked Different CPU ran on another CPU model than BoringCache at the same level, so part of its time difference can come from the hardware.

One cold and warm build per cache
Cache Cold Warm CPU
Base · sccache compiler cache
BoringCache sccache compiler cache 39 min 29 s 29 min 26 s AMD EPYC 7763
Depot Cache sccache WebDAV backend 43 min 11 s 32 min 55 s AMD EPYC 7763
GHA Cache sccache GitHub Actions backend 40 min 35 s 34 min 39 s Cold: Intel Xeon Platinum 8573C · Warm: AMD EPYC 9V74 Different CPU
kache 33 min 0 s 80.2 s Cold: AMD EPYC 9V74 · Warm: AMD EPYC 7763 Different CPU
Plus · sccache, Cargo registry and target directory
BoringCache + sccache, Cargo registry and target directory 41 min 52 s 59.2 s Cold: AMD EPYC 7763 · Warm: AMD EPYC 9V45
GHA Cache + target sccache plus actions/cache for registry and target 42 min 23 s 28 min 14 s AMD EPYC 7763 Different CPU
mr-boxington 39 min 24 s 34 min 8 s Cold: Intel Xeon Platinum 8573C · Warm: AMD EPYC 9V74 Different CPU

Cache hits

BoringCache · GitHub runner · 4 vCPU

97.1% of 20,352 lookups over 8 builds

Served from the runner
Under 1 ms per read
Measured by sccache
2.0 ms per hit
Read from cache
9.62 GB

Tool reference

Check the tool's own reference when you need cache-key rules, build settings, or version-specific behavior.

All adapter commands

Compare every supported command, protocol, and Action mode in one place.

Adapter command index →

Need help or found something unclear? Open an issue or browse the CLI repo.