Files
1jehuang--jcode/scripts/cargo_exec.sh
T
wehub-resource-sync a789495a98
FreeBSD Smoke / FreeBSD Smoke (x86_64) (push) Has been cancelled
CI / Quality Guardrails (push) Has been cancelled
CI / Build & Test (macos-latest) (push) Has been cancelled
CI / Build & Test (ubuntu-latest) (push) Has been cancelled
CI / Build & Test (windows-latest) (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / PowerShell Syntax (push) Has been cancelled
CI / Windows Cross-Target Check (Linux) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:10:34 +08:00

26 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Thin wrapper used by the test/refactor helper scripts (test_fast.sh,
# test_e2e.sh, refactor_phase1_verify.sh, agent_trace.sh, real_provider_smoke.sh).
#
# Historically this exec'd bare `cargo "$@"`, which meant the test/check
# workflows ran with NONE of the adaptive build controls the selfdev path gets
# via dev_cargo.sh: no memory-aware job sizing, no fast linker (clang+lld/mold),
# and no remote-cargo offload beyond a manual env check. On a memory-constrained
# host that let a `cargo test`/`cargo check` here assume the full core count and
# trip earlyoom/OOM while a concurrent selfdev build was running -- the two
# wrappers fragmenting the build instead of cooperating.
#
# Delegating to dev_cargo.sh unifies both paths: test/check builds now get the
# same MemAvailable-based CARGO_BUILD_JOBS throttle, the same fast linker, and
# the same remote-cargo handling (dev_cargo.sh performs its own JCODE_REMOTE_CARGO
# preflight, so we no longer duplicate it here). dev_cargo.sh passes every arg
# straight through to cargo, only layering env/setup, so `test`/`check`/`build`
# semantics are unchanged. The low-memory *selfdev profile* overrides remain
# gated to --profile selfdev inside dev_cargo.sh, so plain `cargo test` (test
# profile, debug-assertions on) is untouched aside from the job/linker tuning.
repo_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
exec "$repo_root/scripts/dev_cargo.sh" "$@"