返回 CodeWhale
dev-cargo.sh
根目录 / scripts / dev-cargo.sh
1 #!/bin/sh
2 # Run cargo with the portable Codewhale cache topology applied.
3 #
4 # scripts/dev-cargo.sh check -p codewhale-config --lib --locked
5 # scripts/dev-cargo.sh --status
6 # scripts/dev-cargo.sh --self-check
7 #
8 # This is the everyday compile entry point. It does not change product
9 # behavior. Use scripts/dev-test.sh <area> for tests under the shared temporary
10 # HOME boundary. Arbitrary Cargo commands here do not isolate product config.
11 # See scripts/dev-cache.sh and docs/BUILD_PERFORMANCE.md.
12 set -eu
13
14 repo_root=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd)
15 cd "$repo_root"
16
17 # shellcheck source=scripts/dev-cache.sh
18 . "$repo_root/scripts/dev-cache.sh"
19
20 case ${1:-} in
21 --status|--self-check|--print-exports|--help|-h)
22 exec "$repo_root/scripts/dev-cache.sh" "$1"
23 ;;
24 esac
25
26 codewhale_dev_cache_apply
27 # Match CI / the product's 16 MiB owner-thread stack so local cargo test
28 # and nextest do not abort on the default ~2 MiB (Windows ~1 MiB) stack.
29 if [ -z "${RUST_MIN_STACK:-}" ]; then
30 RUST_MIN_STACK=16777216
31 export RUST_MIN_STACK
32 fi
33 codewhale_dev_cache_exec_cargo "$@"
34
34 lines BASH