Don't use CARGO_BUILD_JOBS in hash keys#2328
Conversation
|
(Perhaps we can discuss what other variables should be excluded or whether sccache could have a knob that allows the user to select which environment variables to exclude from the key, though I understand that having a knob may complicate things unnecessarily) |
`CARGO_BUILD_JOBS` only affects Cargo's parallelism, not rustc's outputs, so it can be safely excluded from the cache key. This enables better cache reutilization when building from environments with different number of CPUs.
c2851b2 to
85eabc0
Compare
|
I think a long-term solution would be to have a meta-key, that allows to exclude arbitrary environment variables from being included. Out of scope for this PR though. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2328 +/- ##
=======================================
Coverage 71.58% 71.58%
=======================================
Files 65 65
Lines 36214 36221 +7
=======================================
+ Hits 25923 25930 +7
Misses 10291 10291 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Someone who can press the merge button here? It's just sitting around in approved state. |
CARGO_BUILD_JOBSonly affects Cargo's parallelism, not rustc's outputs, so it can be safely excluded from the cache key.This enables better cache reutilization when building from environments with different number of CPUs.
I ran into this while experimenting with sccache on a containerized system where a library can be shared/compiled between different job sizes, and was surprised that I was getting cache misses for those libraries.
Given how small the change is, I figured opening the PR wouldn't hurt, but please let me know if you prefer me to move this to an issue for further discussion before actually having the PR reviewed.