Files
DeepSeek-TUI/scripts/dev-cargo.sh
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

32 lines
944 B
Bash
Executable File

#!/bin/sh
# Run cargo with the portable Codewhale cache topology applied.
#
# scripts/dev-cargo.sh test -p codewhale-config --lib --locked
# scripts/dev-cargo.sh --status
# scripts/dev-cargo.sh --self-check
#
# This is the everyday compile entry point. It does not change product
# behavior. See scripts/dev-cache.sh and docs/BUILD_PERFORMANCE.md.
set -eu
repo_root=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd)
cd "$repo_root"
# shellcheck source=scripts/dev-cache.sh
. "$repo_root/scripts/dev-cache.sh"
case ${1:-} in
--status|--self-check|--print-exports|--help|-h)
exec "$repo_root/scripts/dev-cache.sh" "$1"
;;
esac
codewhale_dev_cache_apply
# Match CI / the product's 16 MiB owner-thread stack so local cargo test
# and nextest do not abort on the default ~2 MiB (Windows ~1 MiB) stack.
if [ -z "${RUST_MIN_STACK:-}" ]; then
RUST_MIN_STACK=16777216
export RUST_MIN_STACK
fi
codewhale_dev_cache_exec_cargo "$@"