Repository navigation
Description
Problem
Bare CI builds (jobs that compile Rust on the runner with sccache and the GitHub Actions cache backend, adopted in docs/adrs/20260612000000_adopt_sccache_for_ci_bare_builds.md) fail before compiling anything when the sccache server does not start within 10 seconds:
error: process didn't exit successfully: `sccache .../rustc -vV` (exit status: 2)
sccache: error: Timed out waiting for server startup. Maybe the remote service is unreachable?
##[error]Process completed with exit code 101.
The first cargo command runs sccache rustc -vV (because RUSTC_WRAPPER=sccache). The client starts the server and waits at most 10 s for it. With the GitHub Actions cache backend the server talks to the cache service while it starts; when that service is slow, the client gives up and the job fails.
On 2026-11-23 (20:00–22:04 UTC) this failed OS Compatibility run 45253124047 attempts 2 (ubuntu-latest) and 3 (macos-latest) on PR #3012, and Unit (stable) in Testing runs 45253124156 (PR #3012) and 45270620775 (PR #3013). Other jobs in the same period passed and no workflow changed on develop, so the cause is the cache service.
A cache is an optimization: an unavailable cache should cost build time, not fail the build.
Why SCCACHE_IGNORE_SERVER_IO_ERROR is not enough
In the sccache v0.20.0 source (the version CI installs) that variable only applies when reading a compile response from a server that is already running. The startup path returns the timeout error unconditionally. Reproduced locally: with the variable set to 1 the build still fails with the same error.
Proposed fix
- A shared local composite action
.github/actions/enable-sccachereplaces the tenEnable sccachesteps intesting.yaml,os-compatibility.yaml,db-compatibility.yaml,coverage.yamlanddb-benchmarking.yaml. - It runs
sccache --start-serverand exportsRUSTC_WRAPPER=sccache/SCCACHE_GHA_ENABLED=trueonly if the server started; otherwise it stops any half-started server, emits a warning annotation and the job builds without the cache. SCCACHE_IDLE_TIMEOUT=0keeps the server alive for the whole job, so the checked startup is the only one.shell: bash, so it also runs onwindows-latest.- An amendment to the sccache ADR.
Verification: a temporary commit forcing the timeout (server_startup_timeout_ms = 1) must fail the unit job before the fix and pass with the warning after it; normal runs must still show cache hits.
Specification: docs/issues/open/3019-ci-sccache-startup-fallback/ISSUE.md (spec-only PR first).
Activity
docs(issues): [torrust#3019] start the sccache server with the GitHub…
docs(issues): [torrust#3019] verify on fork branches, including the j…
docs(pr-reviews): [torrust#3019] record the CodeRabbit review round o…
docs(pr-reviews): [torrust#3019] cite issue torrust#3019 instead of t…
docs(pr-reviews): [torrust#3019] record CodeRabbit's second review ro…
docs(pr-reviews): [torrust#3019] quote the issue torrust#3019 entry i…
docs(pr-reviews): [torrust#3019] record CodeRabbit's third review rou…
docs(issues): [#3019] add the specification for the sccache startup f…
Merge #3020: docs(issues): add issue specification for #3019
ci: [torrust#3019] build without sccache when its server does not start
docs(adrs): [torrust#3019] amend the sccache ADR with the startup fal…
docs(issues): [torrust#3019] record the implementation progress of th…
docs(issues): [torrust#3019] run the forced-timeout checks on throwaw…
docs(issues): [torrust#3019] record the hosted red and green runs of …
docs(issues): [torrust#3019] record the normal hosted run of PR 3040
Merge torrust#3040: fix(ci): [torrust#3019] build without sccache whe…
docs(issues): [torrust#3019] keep T6b open until the post-merge runs …
docs(pr-reviews): [torrust#3019] record the Greptile review round of …
chore(issues): archive closed issue #3019 spec to docs/issues/closed
Merge #3046: chore(issues): archive closed issue #3019 spec to docs/i…