Skip to content
CAI
Software that uses CAICheck a score

mozilla/sccache

68.9

Adequate · 27 October 2026

43.6k

lines of production code

Rust

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a distributed compilation caching service that accelerates build processes by storing and retrieving compiler artifacts across local and remote storage backends. It supports multi-level caching with automatic backfilling, allowing clients to bypass the central server for direct cache access while maintaining a distributed architecture for remote execution. The system integrates with various compilers and cloud storage providers, featuring robust authentication mechanisms and comprehensive testing infrastructure to ensure reliability across different operating systems and build environments.

How it got here

2014–2016 — Client-side caching and multi-level storage

6 changes.

The project introduced a client-side mode allowing direct cache access, bypassing the background server for storage operations. It also implemented multi-level caching with automatic backfilling to optimize hit rates across different storage backends. These features were supported by a comprehensive refactor of compiler execution into a unified trait and the establishment of robust test infrastructure.

2017–2018 — distributed compilation infrastructure

5 changes.

This period focused on implementing the core infrastructure for distributed compilation, including toolchain packaging, HTTP abstractions, and OAuth/PKCE authentication. It also expanded platform support to FreeBSD using container isolation and introduced comprehensive integration tests to validate the new distributed features across various compilers and environments.

2021–2026 — Infrastructure and testing expansion

7 changes.

This period focused on establishing the core LRU disk cache implementation and refactoring the sccache-dist CLI for better usability. It also involved significant investment in test infrastructure, including Docker-based integration suites, performance benchmarks, and helpers to ensure robustness across various storage backends and build tools.

Features

Add FreeBSD CI test script and extended test runner

Introduces \scripts/freebsd-ci-test.sh\ to automate end-to-end distributed compilation testing on FreeBSD, including setting up a ZFS-backed \pot\ environment, configuring \sccache-dist\ schedulers and servers, and verifying cache usage. Additionally, adds \scripts/extratest.sh\ to run comprehensive \cargo check\ suites across multiple feature combinations (dist-client, dist-server, dist-tests) for both Linux and Windows targets.

scripts · high confidence

Distributed compilation support for FreeBSD and enhanced client authentication

The sccache-dist server now supports distributed compilation on FreeBSD, utilizing the 'pot' container system for build isolation alongside the existing Linux bubblewrap implementation. Additionally, the scheduler's client authentication has been expanded to support multiple strategies, including fixed tokens, JWT validation against a JWKS endpoint, and proxy-based token forwarding, allowing for more flexible and secure integration with identity providers.

src/bin/sccache-dist · high confidence

Introduce client-side mode with direct cache access

sccache now supports a client-side mode where the client binary can directly access the cache storage backend, bypassing the need for a long-running background server for cache operations. This is implemented via new \StorageHandshake\, \StorageGetPath\, \StorageGetRaw\, and \StoragePutRaw\ RPCs in the protocol, allowing the client to fetch and store cache entries directly. The server still handles compilation execution, but the client can now act as a cache client independently, improving reliability and reducing server dependency for cache lookups.

src · high confidence

Introduce distributed compilation support with OAuth/PKCE authentication and toolchain packaging

This change adds the core infrastructure for distributed compilation. It introduces a client-side toolchain cache (\src/dist/cache.rs\) that manages custom toolchain overrides, disabled toolchains, and weak/strong hash mapping for integrity verification. It implements PKCE-based OAuth client authentication (\src/dist/client\_auth.rs\) to secure communication with the scheduler. The module also provides HTTP client/server abstractions (\src/dist/http.rs\) for binary protocol communication, platform-specific path transformation for Windows (\src/dist/mod.rs\), and toolchain packaging logic (\src/dist/pkg.rs\) that bundles compiler executables and their dynamic library dependencies into tar archives for remote execution.

src/dist · high confidence

New multi-level caching with fallback and backfilling

The cache subsystem now supports multi-level storage chains, allowing you to combine multiple backends (such as local disk, Redis, S3, or GCS) into a single cache. The system reads from faster levels first and automatically backfills slower levels with data found in deeper tiers, improving hit rates and reducing latency for remote storage. This is implemented via the new \MultiLevelStorage\ and \MultiLevelStats\ components in \src/cache/multilevel.rs\, which coordinate the fallback logic and expose per-level statistics.

src/cache · high confidence

Repository initialization and development environment setup

The repository is initialized with essential configuration files to standardize the development workflow and packaging. A Nix flake (flake.nix) and its lock file are added to provide reproducible build environments and package definitions for sccache and sccache-dist across multiple platforms. Development tooling is configured via .pre-commit-config.yaml (running rustfmt and clippy), .rustfmt.toml (setting edition 2024), and .taplo.toml (formatting TOML files). Project governance and contributor guidelines are established through AGENTS.md and CODE\_OF\_CONDUCT.md. Additionally, .envrc is added to support nix-direnv integration, and .gitignore is updated to exclude build artifacts, lockfiles, and IDE files. The legacy Python-based sccache.py script is removed.

(repo-wide) · high confidence

Architecture

Refactor compiler implementations to use a unified CompileCommand trait

The compiler subsystem has been refactored to replace the previous compilation execution model with a new \CompileCommand\ trait and its \CCompileCommand\ wrapper. This change introduces a standardized interface for executing compiler invocations, allowing compiler-specific logic in \clang.rs\, \gcc.rs\, \msvc.rs\, and others to delegate command generation and execution through this trait. This unification simplifies how different compilers (GCC, Clang, MSVC, NVCC, etc.) are integrated into the caching and distributed compilation pipelines by providing a consistent abstraction for compile commands.

src/compiler · high confidence

Behavioural changes

Internal LRU disk cache implementation and module structure

The \src/lru\_disk\_cache\ location now contains the core implementation of the LRU disk cache, including the \LruDiskCache\ struct for managing file storage on disk with size limits and the \LruCache\ generic LRU data structure. This change introduces the underlying caching logic, file I/O handling via \fs\_err\, and the module hierarchy (\mod.rs\ and \lru\_cache.rs\) that supports the cache's functionality, such as tracking file sizes and managing eviction based on last-modified times.

_src/lru\_disk\cache · medium confidence

Redesigned sccache-dist CLI with explicit subcommands and improved token generation options

The command-line interface for sccache-dist has been refactored to use the clap builder API, introducing explicit subcommands for authentication, scheduler, and server modes. Users can now generate JWT HS256 server tokens with specific server addresses and secret keys, or generate shared tokens with configurable bit lengths (defaulting to 256 bits, with validation ensuring divisibility by 8 and bounds between 64 and 4096 bits). The CLI also enforces mutual exclusion between config file paths and direct secret key arguments for token generation, and provides clearer error messages for invalid token bit lengths.

src/bin/sccache-dist/cmdline · high confidence

Test coverage

Added MSBuild C++ test project; Added integration test library to randomize directory listing order; Added performance benchmarks for sccache core operations; Added test harness for distributed compilation scenarios; Added test helper infrastructure for sccache integration testing; Added test infrastructure with mock storage and server utilities; Expanded test coverage for sccache functionality; New Docker-based integration test suite for sccache.

Dependencies

Update to Rust 2024 edition and MSRV 1.91

The project has been upgraded to the Rust 2024 edition and the minimum supported Rust version (MSRV) is now 1.91.0. This change requires users to compile sccache with a newer Rust toolchain and may involve updating dependencies to versions compatible with the new edition and compiler version.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 69 → 69 (-0.4)

Lenses

  • Code Health 86 → 86 (+0.4)
  • Architecture 89 → 87 (-1.5)
  • Maturity 71 → 73 (+2.7)
  • Readiness 73 → 73 (+0.0)
  • Security 61 → 59 (-2.1)
  • Performance 94 → 94 (+0.0)

Resolved (20)

  • Ambiguous naming convention for retrieval methods. 'get' vs 'get_raw' implies a distinction (likely deserialized vs raw bytes), but the naming is inconsistent with the put methods ('put' vs 'put_raw') and lacks a clear, uniform pattern across the Storage trait. Furthermore, 'get_with_raw' exists but is unused in the list of core methods, creating confusion about which method to use for raw data access.
  • Duplicated block (13 lines × 2) (src/compiler/diab.rs)
  • Flaky test: sccache::sccache_cargo.test_rust_cargo_run_with_env_dep_parsing
  • Hotspot: src/cache/multilevel.rs (src/cache/multilevel.rs)
  • Hotspot: src/server.rs (src/server.rs)
  • Inconsistent construction pattern. S3Cache uses a builder pattern with 'new' followed by 'with_*' methods and a final 'build()'. Other caches like AzureBlobCache, GCSCache, etc., use a static 'build' method that takes all parameters at once. This forces users to learn different construction idioms for different storage backends.
  • Inconsistent factory method naming. 'build_from_url' uses a 'from_*' pattern, while 'build_single' and 'build_cluster' use a 'build_*' pattern. This breaks the consistency of the builder pattern across different connection types.
  • Inconsistent return types and naming for retrieval. 'get' returns a Result (likely containing data), 'get_file' returns a Result (likely a file handle or path), and 'get_abs_path' returns a PathBuf directly. This inconsistency in return types (Result vs direct value) and naming ('get' vs 'get_file' vs 'get_abs_path') makes the API harder to use correctly.
  • MethodTooLong: MultiLevelStorage.from_config (src/cache/multilevel.rs)
  • MultiLevelStorage::from_config (cyclomatic 24) (src/cache/multilevel.rs)
  • MultiLevelStorage::get (cognitive 31) (src/cache/multilevel.rs)
  • Near-duplicate member pair (62 shared lines) (src/compiler/diab.rs)
  • Off-boarding risk: anonymized user #1
  • Outdated: rustls-native-certs
  • Outdated: typed-path
  • Redundant loading methods. 'Config.load' and 'CachedConfig.load' do similar things (loading configuration), but 'CachedConfig' also has 'reload'. This creates confusion about when to use which method and implies that 'Config' might not be cached while 'CachedConfig' is, but the naming doesn't clearly reflect this distinction.
  • TodoComment (src/compiler/msvc.rs)
  • TodoComment (src/util.rs)
  • TodoComment (src/util.rs)
  • Workflow holding a long-lived secret is unscoped

New (34)

  • Duplicated block (12 lines × 2) (src/compiler/diab.rs)
  • Flaky test: sccache::system.test_assembler_affects_cache::with_preprocessor_cache
  • FunctionTooLong: sccache::compiler::diab::parse_arguments (src/compiler/diab.rs)
  • Hotspot: src/bin/sccache-dist/main.rs (src/bin/sccache-dist/main.rs)
  • Hotspot: src/compiler/diab.rs (src/compiler/diab.rs)
  • Hotspot: src/compiler/tasking_vx.rs (src/compiler/tasking_vx.rs)
  • Medium CVE: RUSTSEC-2026-0381 (Cargo.lock)
  • Medium CVE: RUSTSEC-2026-0381 (Cargo.lock)
  • Medium CVE: RUSTSEC-2026-0383 (Cargo.lock)
  • Medium advisory (unsound): RUSTSEC-2026-0386 (Cargo.lock)
  • Medium advisory (unsound): RUSTSEC-2026-0395 (Cargo.lock)
  • Medium advisory (unsound): RUSTSEC-2026-0397 (Cargo.lock)
  • Medium advisory (unsound): RUSTSEC-2026-0399 (Cargo.lock)
  • Medium advisory (unsound): RUSTSEC-2026-0400 (Cargo.lock)
  • Medium advisory (unsound): RUSTSEC-2026-0401 (Cargo.lock)
  • Medium advisory (unsound): RUSTSEC-2026-0402 (Cargo.lock)
  • Medium advisory (unsound): RUSTSEC-2026-0404 (Cargo.lock)
  • Medium advisory (unsound): RUSTSEC-2026-0406 (Cargo.lock)
  • Medium vulnerability: [GHSA redacted] (Cargo.lock)
  • Medium vulnerability: RUSTSEC-2026-0367 (Cargo.lock)
  • …and 14 more

Changes since last survey

  • 45 commits — 37 feature/other, 8 fixes

By area

  • src/compiler — 14 commits
  • src/cache — 11 commits
  • (root) — 4 commits
  • src/commands.rs — 3 commits
  • src/util.rs — 3 commits
  • src/dist — 2 commits
  • tests/sccache_args.rs — 2 commits
  • tests/system.rs — 2 commits
  • docs/Configuration.md — 1 commit
  • src/bin — 1 commit
  • src/client.rs — 1 commit
  • src/server.rs — 1 commit

Notable commits

  • fix: Fix crate_link_paths scan for no-hash dep files
  • fix: Fix parse_rustc_z_ls for deps without -HASH suffix
  • fix: Harden no-hash Rust dist regression coverage
  • fix: fix(cache): backfill multilevel raw hits
  • fix: fix(cache): continue raw reads after level errors
  • fix: fix(cache): record multilevel raw-read stats
  • fix: fix: address no-hash dist review
  • fix: test(cache): split raw backfill regression
  • change: Add CacheConfigs.cache_type_by_name to reduce boilerplate
  • change: Address review points
  • change: Keep the original level name in multilevel cache errors
  • change: Look up true on PATH in the symlinked libdir test
  • change: Release 0.19.0
  • change: Remove unused _pool parameter
  • change: Update typed-path dependency to 0.13
  • change: bench: cover direct-mode lookups of the preprocessor cache
  • change: cache: report remote read errors instead of treating them as misses
  • change: cache: test that missing remote entries remain cache misses
  • change: client: say the server hung up instead of "failed to fill whole buffer"
  • change: commands: read preprocessor entries from the configured disk cache dir
  • …and 25 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

mozilla/sccache was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 27 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit dac6c807c65f5c9009efe492f458288a3c16248a — the exact code this score is about.
  • Scored under rubric-2026.10.5 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer measure-2026.10.34+preprod-c12eef3a1477.