sccache 0.21.0
Summary
sccache 0.21.0 can cache ThinLTO code generation at link time, adds a fallback bucket to the GCS
cache, and lets each compile set its own base directories. It also fixes a few cache keys, fixes a
long-lived server that could stall, and keeps sccache's own log lines off the compiler's stderr.
Highlights:
- ThinLTO: with clang and lld,
sccache --dtltocan be the Distributed ThinLTO distributor.
It runs each backend job as an ordinary compile and caches it, keyed on the bitcode module, its
index and every module it imports from. Seedocs/ThinLTO.md(#3045). - GCS:
SCCACHE_GCS_FALLBACK_BUCKET(or a[cache.gcs.fallback]table) names a read-only
bucket to look up when the main bucket misses. Hits are copied into the main bucket. In Firefox
CI, 22% of the linux64 misses were already in the other region's bucket (#3093). - Base directories:
SCCACHE_BASEDIRSis also read from each compile's environment and
overrides the server's value for that compile, so each checkout can set its own root (#3065).
For Rust, the Cargo build directory is stripped from env-dep values such asOUT_DIR, so a
sharedbuild.build-diroutside the checkout no longer prevents hits (#3051). - Cache-key correctness: in preprocessor cache mode, headers that use
__DATE__or
__TIMESTAMP__are now compared by content, so a same-size edit no longer gets the old object
(#2954). clang sample profiles and profile lists are hashed by content (#3060).CPATH,
C_INCLUDE_PATH,CPLUS_INCLUDE_PATH,OBJC_INCLUDE_PATHandOBJCPLUS_INCLUDE_PATHare part
of the key (#2799). Compiler processes now get only the client's environment, not the server's
(#3016). - Reliability: when the server kills a rustc that holds jobserver tokens, it now switches to a
fresh pool. Before, a long-running server leaked those tokens until no compile could start
(#3047).SCCACHE_IGNORE_SERVER_IO_ERROR=1now also falls back to the local compiler when
sccache can't connect to or start the server (#2756). When sccache wraps a compiler, its
SCCACHE_LOGoutput goes toSCCACHE_ERROR_LOGinstead of the stderr it shares with the
compiler. That stray output used to break autotools feature probes, for example by dropping
-fPIC(#3088).--show-statsreports direct-mode hits separately (#2860). - Compiler support: clang
-Xclang -fopenmp(#3062) and-Xclang -fno-cxx-modules(#2717),
clang/clang-cl instrumentation generation with an output path (#3074), MSVC/Zl(#3059), and
nvcc-Gno longer takes the next argument as its value (#3081).
Welcome to 7 new contributors!
Features
- clang: cache ThinLTO backend compilations by @Felixoid in #3045
- Add a fallback bucket to the GCS cache by @sylvestre in #3093
- feat(sccache): Per-compile basedirs by @Felixoid in #3065
- Direct mode stats by @badumbatish in #2860
- feat/startup: add domain socket for daemon launch to funnel information by @drahnr in #3015
Compiler support
- clang: cache compiles that pass -fopenmp through -Xclang by @puretechteam in #3062
- Add -fno-cxx-modules to clang's known -Xclang flags by @badumbatish in #2717
- msvc: recognize direct clang-cl instrumentation generation by @marcpems in #3074
- Omit default library name for MSVC by @exoosh in #3059
- nvcc: treat -G as a flag without an argument by @Yahiro025 in #3081
Fixes
- preprocessor cache: compare time-macro headers by content by @lenamonj in #2954
- clang: hash the contents of sample profiles and profile lists by @Felixoid in #3060
- Add
CPATHto the list of cached env vars by @fheinecke in #2799 - mock_command: add new_command_with_env so compiler children get only the client environment by @loganrosen in #3016
- rust: with basedirs set, strip the Cargo build dir from env-dep values by @art-shen in #3051
- jobserver: replace the pool when a compiler dies holding tokens by @caniko in #3047
- fall back locally on server connection/startup failures by @ken-matsui in #2756
- logging: send the wrapper client's log records to SCCACHE_ERROR_LOG by @jetm in #3088
- sccache-dist: accept a --secret-key value that starts with a hyphen by @puretechteam in #3078
- docs: list the S3 permissions sccache needs by @puretechteam in #3063
Dependencies
- deps: bump which from 6 to 8 by @loganrosen in #3073
- deps: update url to 2.5.9 (RUSTSEC-2026-0592) by @loganrosen in #3075
Tests & CI
- tests: run with cargo-nextest and in parallel by @loganrosen in #3077
- tests: stop relying on Cargo's target layout to find binaries by @loganrosen in #3076
- tests: fix sccache_args build after nextest migration by @badumbatish in #3091
- tests: fix DTLTO tests build after nextest migration by @badumbatish in #3097
- tests: don't use compiler wrappers as the compiler under test by @avikivity in #3092
- test: Set and use defaults for some structs by @badumbatish in #3098
- rust: Rename a test case description that is a Rust keyword by @cryptomilk in #3072
Cleanup
- randomize_readdir: inherit workspace lints in Cargo.toml by @Devel08 in #3070
- prepare 0.21.0 by @sylvestre in #3099
New Contributors
- @puretechteam made their first contribution in #3062
- @Devel08 made their first contribution in #3070
- @caniko made their first contribution in #3047
- @lenamonj made their first contribution in #2954
- @fheinecke made their first contribution in #2799
- @ken-matsui made their first contribution in #2756
- @Yahiro025 made their first contribution in #3081
Full Changelog: v0.20.1...v0.21.0