mirror of
https://github.com/ulpi-io/skills.git
synced 2026-09-19 03:35:17 +08:00
ship-playbook — drop the kache pre-warm (the store self-warms); keep it only as a cold-store trip-wire
kache is content-addressed and path/target-dir-independent, so its store warms itself across worktrees and persists across runs — the first worktree to compile a crate populates it and every other worktree and later run hardlinks it (measured ~97% cross-worktree hits, 51 GiB persistent store). A pre-warm on a hot store is just a full workspace build that's all hits — dead weight. Remove the automatic kache pre-warm from the warm step; document the one case it earns its keep (a genuinely COLD store — fresh machine, kache purge, or Cargo.lock/toolchain bump — with a wide first build layer) as a trip-wire. The no-kache path is unchanged: it still builds ROOT/target so worktrees CoW-seed it. Wording clarified so a kache repo is never described as cold-building (kache still wraps via .cargo/config.toml).
This commit is contained in:
@@ -171,7 +171,7 @@ ${SEED_SCRIPT}
|
||||
• package.json present & node_modules absent → frozen install (pnpm i --frozen-lockfile / npm ci / yarn --immutable).
|
||||
• composer.json present & vendor absent → composer install --prefer-dist.
|
||||
• ios/Podfile present & ios/Pods absent → (cd ${ROOT}/ios && pod install).
|
||||
• Cargo.toml present → if the repo wires \`kache\` (\`.cargo/config.toml\` sets \`rustc-wrapper = "kache"\`, or \`kache\` is on PATH): PRIME the shared kache store so the build fan-out RESTORES instead of each worktree cold-compiling the dep graph — build the workspace ONCE into a THROWAWAY target dir so ROOT's local incremental cache is left untouched (kache's store is target-dir-independent): \`W=$(mktemp -d); CARGO_TARGET_DIR="$W" cargo build --manifest-path ${ROOT}/Cargo.toml --workspace --all-targets\` (tail the output), then \`rm -rf "$W"\`. Report the \`kache stats\` store-size/hit-rate line. kache needs NO daemon, NO config file, NO size env, and auto-strips incremental flags (needs rustc ≥ 1.95). OTHERWISE (no kache): build the warm target/ base ONCE so every worktree can CoW-seed it — \`cargo build --workspace\` in ${ROOT} (add \`--tests\` if the validate runs tests). Use ROOT's normal profile — do NOT set CARGO_INCREMENTAL=0 (that would clobber the dev's local incremental fast-loop); the seed script then \`cp -c\` CoW-clones ${ROOT}/target into each worktree (0 disk) and \`touch\`es it so cargo reuses unchanged crates.
|
||||
• Cargo.toml present → if the repo wires \`kache\` (\`.cargo/config.toml\` sets \`rustc-wrapper = "kache"\`, or \`kache\` is on PATH): NOTHING to pre-warm — SKIP it. kache's content-addressed, path-independent store warms ITSELF (the first worktree to compile a crate populates the store; every other worktree AND every later run hardlinks it) and PERSISTS across runs, so a pre-warm would just be a full workspace build that is all cache hits — dead weight while the store is hot. TRIP-WIRE (the ONE case a pre-warm earns its keep): if the store is genuinely COLD — a fresh machine, a \`kache\` purge, or a Cargo.lock / toolchain bump that invalidates keys — AND the first build layer is wide, pre-compile the base graph once so N first-layer worktrees don't each cold-compile it: \`cargo build --workspace\` in ${ROOT} (do NOT set RUSTC_WRAPPER — an env export overrides the config and DEFEATS kache; kache still wraps via the config, so this is all-hits after the first). OTHERWISE (no kache): build the warm target/ base ONCE so every worktree can CoW-seed it — \`cargo build --workspace\` in ${ROOT} (add \`--tests\` if the validate runs tests). Use ROOT's normal profile — do NOT set CARGO_INCREMENTAL=0 (that would clobber the dev's local incremental fast-loop); the seed script then \`cp -c\` CoW-clones ${ROOT}/target into each worktree (0 disk) and \`touch\`es it so cargo reuses unchanged crates.
|
||||
• Go / other → nothing (caches already global).
|
||||
Report ok:true when done (even with build errors — whatever compiled/installed is now seedable).`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user