Skip to content

fix(ci): don't invoke sccache when R2 secrets are unset#356

Closed
lgahdl wants to merge 2 commits into
nullislabs:developfrom
bleu:fix/337-sccache-fork-secrets
Closed

fix(ci): don't invoke sccache when R2 secrets are unset#356
lgahdl wants to merge 2 commits into
nullislabs:developfrom
bleu:fix/337-sccache-fork-secrets

Conversation

@lgahdl

@lgahdl lgahdl commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #337. Fork-headed pull_request runs don't receive repo secrets, so secrets.R2_ACCOUNT_ID evaluates to empty string and SCCACHE_ENDPOINT becomes https://.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_WRAPPER to only point at sccache when R2_ACCOUNT_ID is actually set:

RUSTC_WRAPPER: ${{ secrets.R2_ACCOUNT_ID != '' && 'sccache' || '' }}

On runs without the secret (forks), RUSTC_WRAPPER is empty, which cargo treats as a no-op — builds just proceed uncached instead of failing outright. All other SCCACHE_*/AWS_* env vars are left as-is; they're simply unused once the wrapper itself is never invoked.

Test plan

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.
@lgahdl
lgahdl requested a review from mfw78 as a code owner July 15, 2026 14:48
A reader hitting this line cold has no way to tell why sccache is
sometimes skipped without tracing back to nullislabs#337.
@lgahdl

lgahdl commented Jul 20, 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).

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