diff --git a/.cargo/config.toml b/.cargo/config.toml index 52a50aad..4c0db30a 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -5,8 +5,10 @@ # (cargo does not resolve runner paths relative to this file, and an absolute # path would break other worktree checkouts of this repo). `git bisect run` # exports GIT_DIR, which would make that rev-parse resolve the test package -# dir instead of the repo. Strip the leaked git vars first. -runner = ["bash", "-c", "root=$(env -u GIT_DIR -u GIT_WORK_TREE -u GIT_INDEX_FILE git rev-parse --show-toplevel) && exec \"$root/scripts/memguard-runner.sh\" \"$@\"", "--"] +# dir instead of the repo. Strip the leaked git vars first. Trees without +# .git (cargo-mutants scratch copies, remote-run rsyncs) walk up from the cwd to +# the first dir holding the runner instead. +runner = ["bash", "-c", "root=$(env -u GIT_DIR -u GIT_WORK_TREE -u GIT_INDEX_FILE git rev-parse --show-toplevel 2>/dev/null) || { root=$PWD; while [ \"$root\" != / ] && [ ! -x \"$root/scripts/memguard-runner.sh\" ]; do root=$(dirname \"$root\"); done; }; exec \"$root/scripts/memguard-runner.sh\" \"$@\"", "--"] [env] # The AV1 rate-target tests keep several frames' worth of encoder state on the