3 Commits

Author SHA1 Message Date
Codewhale 853bbb2513 chore(scripts): dev-cache warns before it fills a disk
The #5465 wedge was dev-cache.sh putting ~6 GB build dirs on a volume with
6.5 GiB free and running it to ENOSPC. Add a free-space probe: warn when the
volume holding the cache root has less than CODEWHALE_DEV_CACHE_MIN_FREE_GIB
free, name the cold-build cost (~6 GB), and point at the escape hatches
(CODEWHALE_CACHE_ROOT, the volume-preference envs). Dev tooling only; no
product behavior changes.
2026-08-18 19:22:35 -07:00
CodeWhale Bot 66b9d289b3 fix(dev-cache): isolate build-dir even when a stub ./target exists
Cargo still writes CACHEDIR.TAG (and sometimes final artifacts) under
./target when build-dir is split, so the old auto-mode treated a
freshly-isolated worktree as warm on the second command and recompiled
everything into a second tree. auto now always isolates;
CODEWHALE_DEV_CACHE=local is the explicit stay-in-./target opt-out.

dev-cache.test.sh: all 22 checks pass on this tree.
2026-08-15 21:01:45 -07:00
CodeWhale Bot 178a2f5a01 chore(dev): isolate worktree builds and wire nextest into dev-test
scripts/dev-test.sh only mapped an area onto cargo test -p; a new
worktree still compiled into a private cold ./target. Add
scripts/dev-cache.sh and scripts/dev-cargo.sh so the measured isolated
build-dir topology is actually applied.

New worktrees get CARGO_BUILD_BUILD_DIR under
${CODEWHALE_CACHE_ROOT:-${XDG_CACHE_HOME:-$HOME/.cache}/codewhale}
with Cargo's {workspace-path-hash} (passed as --config so the
template expands). sccache wraps rustc only when incremental is
already off; a missing binary is a printed fallback, not an error.
Cargo older than 1.91 falls back to a per-workspace CARGO_TARGET_DIR.
Already-set CARGO_TARGET_DIR / CARGO_BUILD_BUILD_DIR / RUSTC_WRAPPER
are left alone. Defaults contain no machine-local path.

dev-test.sh now routes every workspace crate, prefers cargo-nextest
when installed (CODEWHALE_DEV_NEXTEST=0 forces libtest), and exports
RUST_MIN_STACK=16MiB when unset. nextest retries stay 0. Hermetic
checks: scripts/dev-cache.test.sh (22) and scripts/dev-test.test.sh
(27), passing under both /bin/sh and dash.
2026-08-15 20:57:11 -07:00