server: scope SCCACHE_BASEDIRS to compiler requests - #2814
Draft
tcashel wants to merge 11 commits into
Draft
Conversation
This was referenced Aug 18, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2814 +/- ##
==========================================
+ Coverage 73.71% 74.10% +0.38%
==========================================
Files 72 73 +1
Lines 37932 37684 -248
==========================================
- Hits 27963 27927 -36
+ Misses 9969 9757 -212 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tcashel
force-pushed
the
codex/request-scoped-basedirs
branch
from
August 22, 2026 02:22
102b45f to
bd21c42
Compare
tcashel
force-pushed
the
codex/request-scoped-basedirs
branch
from
August 22, 2026 02:51
bd21c42 to
019a7c1
Compare
This was referenced Aug 26, 2026
sylvestre
reviewed
Aug 26, 2026
| bencher.bench(|| black_box(strip_basedirs(black_box(&output), black_box(&basedirs)))); | ||
| } | ||
|
|
||
| #[divan::bench(args = [0, 1, 8, 32])] |
Collaborator
There was a problem hiding this comment.
please add the benchmark in a different pr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
I often have several coding agents build the same Rust project from separate Git
worktrees. Each build can identify its own checkout root, but the sccache daemon
currently captures
SCCACHE_BASEDIRSwhen it starts. Supporting anotherworktree therefore requires restarting the daemon or adding every checkout to
one global list.
This draft depends on #2813 and contains one commit on top of it. Until #2813
merges, GitHub includes both commits in this PR; view the follow-up-only
diff.
I'll rebase this branch onto
mainafter #2813 merges.Change
Each compiler invocation can now override the file-configured
basedirs. IfSCCACHE_BASEDIRSis absent, the invocation uses the configured fallback. Anempty value disables that fallback, while a relative value fails only that
invocation. Each request gets an isolated storage view, so concurrent builds
cannot affect one another. The same rules apply with
SCCACHE_CLIENT_SIDE=1.For example, these builds can use one running daemon:
Only the config file defines the daemon fallback, and statistics continue to
report only that value. This change does not discover Git worktrees, expand
wildcard roots, or add a wire-protocol field.
Validation
On Apple silicon, the required formatting, clippy, and locked test suites passed.
Focused Cargo tests cover daemon reuse, both client modes, override precedence,
configured statistics, and concurrent requests.
I also ran the final branch on Ubuntu x86_64. The full locked suite and all
single-backend builds passed. NVCC 12.4 ran both CUDA system-test modes without
skipping. In a two-root canary, request-scoped basedirs added a cross-root
CUDAhit while one daemon stayed running; the device-code and PTX stages stillmissed.
The repository benchmark suite also completed. In one local run,
cache_key_generationhad a 31.87 µs median, compared with 31.41 µs in thePR #2813 run.
Fixes #2595.
I used OpenAI Codex (
gpt-5.6-sol, ultra reasoning) during implementation,testing, benchmarking, and review. I'll review the full diff and CI results
myself before marking the PR ready.