ci: gate the sccache wrapper on the R2 secret so fork PRs build uncached#526
Closed
lgahdl wants to merge 1 commit into
Closed
ci: gate the sccache wrapper on the R2 secret so fork PRs build uncached#526lgahdl wants to merge 1 commit into
lgahdl wants to merge 1 commit into
Conversation
RUSTC_WRAPPER was set to sccache unconditionally at the workflow env level. GitHub withholds repo secrets from pull_request runs whose head is a fork, so R2_ACCOUNT_ID interpolates to empty, the R2 endpoint becomes a nonexistent host, and sccache's server refuses to start - failing clippy/test before anything compiles. Only enable the wrapper when the secret is present; fork PRs fall back to an uncached-but-green build, which is also the right degradation since they shouldn't reach the write-capable shared cache anyway. Closes #337
Collaborator
Author
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.
Summary
ci.ymlsetsRUSTC_WRAPPER: sccacheunconditionally at the workflow env level, alongside the R2-backedSCCACHE_*/AWS_*config.pull_requestruns whose head is a fork, soR2_ACCOUNT_IDinterpolates to empty, the sccache endpoint becomes a nonexistent host, and sccache's server refuses to start - failingclippy/testbefore anything even compiles.RUSTC_WRAPPERtosccachewhensecrets.R2_ACCOUNT_IDis non-empty, so fork PRs fall back tocargo's default (no wrapper) and build uncached-but-green - which is also the right degradation, since fork PRs shouldn't reach the write-capable shared cache anyway.This is the same fix I'd proposed in #356, reimplemented fresh against current
develop(that PR was closed as apparently superseded by #475, which turned out to live deep in an unmerged PR train and won't land soon - so the underlying bug was still live ondevelop).Closes #337