Skip to content

CI bare builds fail when the sccache server does not start #3019

Done

Description

@josecelano-bot

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-sccache replaces the ten Enable sccache steps in testing.yaml, os-compatibility.yaml, db-compatibility.yaml, coverage.yaml and db-benchmarking.yaml.
  • It runs sccache --start-server and exports RUSTC_WRAPPER=sccache / SCCACHE_GHA_ENABLED=true only 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=0 keeps the server alive for the whole job, so the checked startup is the only one.
  • shell: bash, so it also runs on windows-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

  1. added 7 commits that reference this issue on Nov 24, 2026
  2. added 2 commits that reference this issue on Nov 24, 2026
  3. added 6 commits that reference this issue on Nov 24, 2026
  4. added a commit that references this issue on Nov 25, 2026
  5. added 2 commits that reference this issue on Nov 25, 2026
  6. added 2 commits that reference this issue on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions