fall back locally on server connection/startup failures#2756
Open
ken-matsui wants to merge 1 commit into
Open
Conversation
README.md states:
To have sccache instead gracefully failover to the local compiler
without stopping, set the environment variable
`SCCACHE_IGNORE_SERVER_IO_ERROR=1`.
This patch extends this behavior to failures that happen during
connect_or_start_server.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2756 +/- ##
==========================================
- Coverage 74.18% 73.32% -0.86%
==========================================
Files 71 71
Lines 40491 40554 +63
==========================================
- Hits 30037 29736 -301
- Misses 10454 10818 +364 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Author
|
Hi @sylvestre, the CI error looks unrelated to this patch. Could you please rerun it and review this? Thank you! |
Author
|
Ping @sylvestre |
anthonyshew
added a commit
to vercel/sccache
that referenced
this pull request
Jul 7, 2026
…lures Hand-applied port of mozilla#2756 (which is stacked on the unmerged client-side-mode PR upstream) onto the v0.16.0 base: when the client cannot connect to or start the background server and SCCACHE_IGNORE_SERVER_IO_ERROR is set, warn and run the compiler directly instead of failing the compilation. Without this, a storage self-check failure at server startup (e.g. an unreachable or unauthorized cache backend) makes every wrapper invocation exit 2 and fails the build — an optimization must never do that.
anthonyshew
added a commit
to vercel/turborepo
that referenced
this pull request
Jul 7, 2026
> Stacked on #13298 (retargets to main when it merges). ## Why Bench run [28839285743](https://github.com/vercel/turborepo/actions/runs/28839285743) exposed the compile cache's worst failure mode: with unauthorized credentials, sccache's background server failed its storage self-check at startup, refused to start, and every wrapper invocation exited 2 — cargo saw failed rustc calls and **the build failed**. An optimization must degrade to "slower", never to "broken". ## What Two independent layers: 1. **Don't start when the run already knows the backend is doomed.** The proxy gate now checks the resolved runtime `RemoteCacheStatus` (which folds in the preflight: auth failure, unreachable API, team over limit/paused) instead of configuration alone. The bench run had literally printed `Remote caching unavailable (Authentication failed)` before starting the proxy anyway. 2. **Don't die when it breaks mid-run.** The fork picks up a port of mozilla/sccache#2756 (hand-applied to the v0.16.0 base — upstream it's stacked on the unmerged client-side-mode PR): with `SCCACHE_IGNORE_SERVER_IO_ERROR=1` — now injected — a client that cannot connect to or start the server warns and runs the compiler directly. Covered by two integration tests on the fork (forced startup failure → fallback with the env var, hard error without). Also tightens #13298's `CARGO_INCREMENTAL` tolerance: reading sccache's wrapper source revealed it **hard-exits** on `CARGO_INCREMENTAL=1`, so tolerating arbitrary pre-set values could itself fail builds. Only an ambient `0` composes; any other explicit value stands the injection down (incremental compilation was deliberately requested and is incompatible with sccache). ## How Layer 1 kills the predictable class before any wrapper runs; layer 2 is the guarantee for everything unpredictable. Fork rev bumped to `52bfcd0` (`vercel/main-from-args`). Verified: fork integration tests for the fallback both ways; `compile_cache_env` matrix updated (`=0` tolerated, `=1` stands down); workspace check/lint/fmt green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
README.md states:
This patch extends this behavior to failures that happen during connect_or_start_server.