Repository navigation
Make sccache read-only outside main - #1909
Conversation
PR runs filled the cache past its limit and evicted the main caches that every PR reads. PRs lose sccache reuse between pushes, but this is fine since PR entries were evicted within an hour anyway, so no big deal. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused configuration change correctly applies sccache’s supported read-only mode to non-main refs.
0 open findings
What changed in this PR
Makes sccache read-only outside main to protect shared cache entries from eviction.
Changes:
- Sets
SCCACHE_GHA_RW_MODE=READ_ONLYfor non-main refs. - Documents the cache-write policy.
| File | Description |
|---|---|
.github/actions/setup-sccache/action.yml |
Restricts sccache writes to main. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Benchmark ResultsMeasured commit: kvm / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
kvm / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / amd (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / intel (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
Reported by |
Make sccache read-only on every ref except main, so only main writes sccache entries to the GitHub Actions cache. PR runs still read main's entries.
This fixes two problems caused by PR runs writing sccache entries, one per compiled crate:
With these changes, PRs lose sccache reuse between pushes, but this is fine since PR entries were evicted within an hour anyway (due to other prs evicting them), so no big deal. sccache lookups still count toward the download limit, so some rate limiting may remain.