Skip to content

feat: add Rust path remap auto support - #237

Merged
zackees merged 1 commit into
mainfrom
feat/rust-path-remap-auto
May 14, 2026
Merged

feat: add Rust path remap auto support#237
zackees merged 1 commit into
mainfrom
feat/rust-path-remap-auto

Conversation

@zackees

@zackees zackees commented May 14, 2026

Copy link
Copy Markdown
Owner

Closes #229.

Summary

  • add ZCCACHE_PATH_REMAP=auto support for rustc/clippy by injecting a root-covering --remap-path-prefix <worktree-root>=. when needed
  • gate Rust cross-root request/context sharing on a root-covering remap, normalize detached and equals --remap-path-prefix forms, preserve the destination prefix, and keep malformed/external values conservative
  • add Rust parser/context/request-fingerprint tests plus ignored rustc integration tests for file!() auto-remap hits, no-remap misses, different destination-prefix misses, and existing sibling dependency invalidation
  • update README Rust worktree-sharing docs for the now-supported auto directive

Validation

  • cargo test -p zccache-depgraph remap_path_prefix
  • cargo test -p zccache-depgraph rustc_context_key_with_root
  • cargo test -p zccache-daemon rust_remap
  • cargo test -p zccache-daemon effective_compile_args_auto_
  • cargo test -p zccache-daemon --test rustc_cache_test test_rustc_path_remap_auto_file_macro_hits_across_sibling_git_roots -- --ignored --nocapture
  • cargo test -p zccache-daemon --test rustc_cache_test test_rustc_path_remap_conservative_cross_root_misses -- --ignored --nocapture
  • cargo test -p zccache-daemon --test rustc_cache_test test_rustc_sibling_git_worktree_equivalent_cache_sharing -- --ignored --nocapture
  • cargo test -p zccache-daemon --test rustc_adversarial_test rustc_remap_path_prefix_affects_cache_key -- --ignored --nocapture
  • cargo test -p zccache-daemon --test stress_test path_remap_auto_compiles_file_macro_stably_across_git_roots -- --ignored --nocapture
  • cargo test -p zccache-daemon --test link_cache_test test_link_path_remap_auto_hits_across_sibling_git_roots -- --ignored --nocapture
  • cargo test -p zccache-daemon --test perf_bench_test perf_rustc_zccache_vs_sccache -- --ignored --nocapture

Benchmark

Rust benchmark on this machine (C:\ProgramData\chocolatey\bin\rustc.exe), 50 .rs files, 5 warm trials:

Scenario Bare rustc sccache zccache vs sccache vs bare rustc
Build, Cold 6.727s 8.303s 7.710s 1.1x faster 1.1x slower
Build, Warm 6.344s 7.448s 0.135s 55x faster 47x faster
Check, Cold 4.345s 5.796s 5.147s 1.1x faster 1.2x slower
Check, Warm 4.025s 4.983s 0.103s 49x faster 39x faster

Build mode is --emit=dep-info,metadata,link; check mode is --emit=dep-info,metadata.

@codecov

codecov Bot commented May 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.16263% with 66 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/zccache-daemon/src/server.rs 74.21% 66 Missing ⚠️

📢 Thoughts on this report? Let us know!

@zackees
zackees merged commit 77ca399 into main May 14, 2026
13 checks passed
zackees added a commit that referenced this pull request May 28, 2026
zackees added a commit that referenced this pull request May 28, 2026
zackees added a commit that referenced this pull request Jun 2, 2026
Bundles two setup-soldr versions:
- v0.9.58: split foundation vs age-floor eviction counts (diagnostic)
- v0.9.59: drop git SHA from cargo-registry exact key (closes
  setup-soldr#371). Same #237 anti-pattern fix; ~50 MB
  redundant upload saved per matrix-job per CI cycle.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

feat(perf): first-class Rust remap-path-prefix support for worktree-equivalent cache hits

1 participant