fix(ci): don't invoke sccache when R2 secrets are unset#356
Closed
lgahdl wants to merge 2 commits into
Closed
Conversation
Fork-headed pull_request runs don't get repo secrets, so secrets.R2_ACCOUNT_ID evaluates to empty string and sccache starts up against a malformed https://.r2.cloudflarestorage.com/ endpoint, failing clippy/test/rustdoc before any real work happens. Skip the wrapper entirely on those runs instead; RUSTC_WRAPPER="" is a no-op for cargo. Fixes nullislabs#337.
A reader hitting this line cold has no way to tell why sccache is sometimes skipped without tracing back to nullislabs#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
Fixes #337. Fork-headed
pull_requestruns don't receive repo secrets, sosecrets.R2_ACCOUNT_IDevaluates to empty string andSCCACHE_ENDPOINTbecomeshttps://.r2.cloudflarestorage.com/— sccache's server startup then fails against that malformed URL, taking clippy/test/rustdoc down with it before any real compilation happens.This changes
RUSTC_WRAPPERto only point atsccachewhenR2_ACCOUNT_IDis actually set:On runs without the secret (forks),
RUSTC_WRAPPERis empty, which cargo treats as a no-op — builds just proceed uncached instead of failing outright. All otherSCCACHE_*/AWS_*env vars are left as-is; they're simply unused once the wrapper itself is never invoked.Test plan
RUSTC_WRAPPER=""is a no-op forcargo build(tested against a throwaway crate)pull_requestevent — the exact failure condition in ci: sccache R2 config (#336) hard-fails every fork PR — secrets don't flow to fork pull_request runs #337 — so its green run is the real-world confirmation