Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2785 +/- ##
==========================================
+ Coverage 74.32% 74.42% +0.09%
==========================================
Files 71 71
Lines 40789 40932 +143
==========================================
+ Hits 30318 30462 +144
+ Misses 10471 10470 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
still draft? |
|
Thanks for the nudge — the implementation is complete. I revalidated the patch against the current main branch with Rust 1.96: all 496 library tests and the integration suite passed, as did Clippy with warnings denied, rustfmt, and the diff check. I’ve marked this ready for review. |
| #[derive(Debug)] | ||
| pub struct EnvConfig { | ||
| cache: CacheConfigs, | ||
| disk_overrides: DiskCacheConfigOverrides, |
There was a problem hiding this comment.
could you please derive Default on EnvConfig and use ..Default::default() in the tests?
it would avoid touching 20 unrelated tests
| let cache = CacheConfigs { | ||
| azure, | ||
| disk, | ||
| disk: None, |
There was a problem hiding this comment.
cache.disk from env is now always None, maybe add a short comment saying it is handled by disk_overrides?
Summary
SCCACHE_DIR,SCCACHE_CACHE_SIZE,SCCACHE_DIRECT, andSCCACHE_LOCAL_RW_MODEas field-level overridesRoot cause
Setting any local disk cache environment variable previously constructed a complete
DiskCacheConfig, filling every unset field with defaults.CacheConfigs::mergethen replaced the complete file-configured disk object, so an override such asSCCACHE_DIRsilently reset unrelated settings including cache size and nested preprocessor options.The change keeps local disk environment values separate until file and environment cache sources have been merged, then applies only fields that were explicitly set.
User impact
Users can combine a config file with local disk cache environment overrides without losing unrelated file settings.
Fixes #2753.
Validation
cargo test --locked --lib --bins --tests(492 passed, 1 ignored)cargo clippy --locked --all-targets -- -D warnings -A unknown-lints -A clippy::type_complexity -A clippy::new-without-defaultcargo fmt --all -- --checkgit diff --check