ci: fail open on sccache when R2 secrets are absent#475
Open
mfw78 wants to merge 1 commit into
Open
Conversation
Fork pull_request runs receive no repository secrets, so the R2 endpoint interpolated an empty account ID and sccache server startup failed before compiling anything. Gate RUSTC_WRAPPER and SCCACHE_BUCKET on the secret: without it the wrapper is disabled and sccache falls back to local disk, so fork PRs build uncached but green.
lgahdl
approved these changes
Jul 20, 2026
lgahdl
left a comment
Collaborator
There was a problem hiding this comment.
Worth flagging: PR #356 (still open, mine) fixes the exact same issue (#337) with a near-identical RUSTC_WRAPPER guard, but this PR is actually more complete — it also empties SCCACHE_BUCKET for fork runs, which #356 left hardcoded. Since RUSTC_WRAPPER empty means cargo never invokes sccache at all, the malformed SCCACHE_ENDPOINT (empty account id) is harmless either way, but guarding SCCACHE_BUCKET too is the more defensively correct version. I'll close #356 in favor of this one. Logic checks out — approving.
This was referenced Jul 20, 2026
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.
What
Gate
RUSTC_WRAPPERandSCCACHE_BUCKETonsecrets.R2_ACCOUNT_IDbeing non-empty; both fall back to empty when absent.Why
Fork
pull_requestruns get no repo secrets, soR2_ACCOUNT_IDinterpolated empty and sccache tried to reach a nonexistent R2 host, hard-failing clippy and test before any compilation. EmptyRUSTC_WRAPPERis treated as unset by cargo and emptySCCACHE_BUCKETdrops sccache to its local-disk default, so fork PRs now build uncached but green.Closes #337
Testing
CI on this PR (same-repo head, secrets present) exercises the cached path unchanged; fork-PR uncached path is exercised by the existing red fork PRs once rebased.
AI Assistance
Drafted with Claude Code.