‘build test’ builds radicle-remote-helper and radicle-cli, making the assumption that the target directory is always within the source directory. However, the user may have a different idea, specified with the environment variable CARGO_TARGET_DIR (supported by cargo, see https://doc.rust-lang.org/cargo/reference/environment-variables.html).
This change adds support for CARGO_TARGET_DIR, with a fallback to ‘target’ at the top of the source tree if CARGO_TARGET_DIR is undefined.
‘build test’ builds radicle-remote-helper and radicle-cli, making the assumption that the target directory is always within the source directory. However, the user may have a different idea, specified with the environment variable CARGO_TARGET_DIR (supported by cargo, see https://doc.rust-lang.org/cargo/reference/environment-variables.html).
This change adds support for CARGO_TARGET_DIR, with a fallback to ‘target’ at the top of the source tree if CARGO_TARGET_DIR is undefined.
My reason for this is that I wanted to build with a strictly read-only source tree, for example:
$ cargo clean
$ git clean -dfx
$ (echo "export CARGO_TARGET_DIR=/RL-test/target"; echo "cargo test --locked --workspace --no-fail-fast") \
> | podman run -i -v $(pwd):/RL-test/wrk:ro -w /RL-test/wrk rust:trixie bash -xs 2>&1 | tee RL-test.log
Reword commit message.