build fast improvements

This commit is contained in:
James Peter
2025-10-17 14:39:26 +10:00
parent 26e215b75a
commit 19c07e2ac2
2 changed files with 8 additions and 5 deletions
+5 -4
View File
@@ -8,10 +8,11 @@
### Build cache layout and sccache
The fast build now chooses a cache bucket per Git worktree or branch so
concurrent builds no longer fight over `target`. You can override the default
bucket with `BUILD_FAST_CACHE_KEY=my-feature` when you need a stable directory
for long lived experiments. The active bucket is echoed at the start of each
run.
concurrent builds no longer fight over `target`. Each bucket name includes a
hash of the raw ref to keep slashes and similarly named branches distinct. You
can override the default bucket with `BUILD_FAST_CACHE_KEY=my-feature` when you
need a stable directory for long lived experiments. The active bucket is echoed
at the start of each run.
Rust compiler outputs are still shared through `sccache` when it is available.
For best results in a multi-worktree setup, configure a single `sccache`
+3 -1
View File
@@ -256,9 +256,11 @@ if [ -z "${BUILD_FAST_CACHE_KEY:-}" ]; then
else
BRANCH_NAME_RAW="unknown"
fi
BRANCH_FINGERPRINT="$(hash_string "${BRANCH_NAME_RAW}")"
BRANCH_HASH_SHORT="${BRANCH_FINGERPRINT:0:12}"
WORKTREE_HASH="$(hash_string "${WORKTREE_ROOT}")"
WORKTREE_HASH_SHORT="${WORKTREE_HASH:0:12}"
CACHE_KEY_RAW="${BRANCH_NAME_RAW}-${WORKTREE_HASH_SHORT}"
CACHE_KEY_RAW="${BRANCH_NAME_RAW}-${BRANCH_HASH_SHORT}-${WORKTREE_HASH_SHORT}"
CACHE_KEY_SOURCE="branch/worktree"
else
CACHE_KEY_RAW="${BUILD_FAST_CACHE_KEY}"