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@f0fb9b2d926a32b10c543e92093ba00c5a291b79 # v1.33.0
  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 and Zed · compiler-cache reuse and storage.

70–94%

Less cache to store

BoringCache stored 70–94% less cache data across public Go, Gradle, Maven, Nx, Turbo, and sccache comparisons.

Open run →

95.8%

Compiler results reused

1,333 of 1,391 compiler requests hit the shared cache in a Deno build.

Open run →

47

Pinned Docker workloads

The public catalog includes Go build cache, sccache, and Rust target cache mounts inside Docker builds.

Open run →

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.