Skip to content

ci: gate the sccache wrapper on the R2 secret so fork PRs build uncached#526

Closed
lgahdl wants to merge 1 commit into
developfrom
ci/337-sccache-fork-guard
Closed

ci: gate the sccache wrapper on the R2 secret so fork PRs build uncached#526
lgahdl wants to merge 1 commit into
developfrom
ci/337-sccache-fork-guard

Conversation

@lgahdl

@lgahdl lgahdl commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Since ci: dedup compilation and share cache across jobs #336, ci.yml sets RUSTC_WRAPPER: sccache unconditionally at the workflow env level, alongside the R2-backed SCCACHE_*/AWS_* config.
  • GitHub does not expose repo secrets to pull_request runs whose head is a fork, so R2_ACCOUNT_ID interpolates to empty, the sccache endpoint becomes a nonexistent host, and sccache's server refuses to start - failing clippy/test before anything even compiles.
  • Fix: only set RUSTC_WRAPPER to sccache when secrets.R2_ACCOUNT_ID is non-empty, so fork PRs fall back to cargo'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 on develop).

Closes #337

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
@lgahdl
lgahdl requested a review from mfw78 as a code owner July 21, 2026 19:24
@lgahdl

lgahdl commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #475, which fixes the same issue (#337) more completely (also guards SCCACHE_BUCKET, not just RUSTC_WRAPPER).

@lgahdl lgahdl closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: sccache R2 config (#336) hard-fails every fork PR — secrets don't flow to fork pull_request runs

1 participant