rust/hooks: ensure the build output ends up in the right place

Otherwise cargoInstallHook can fail to find and actually install it.
This commit is contained in:
K900 2021-12-26 11:02:26 +03:00
parent c91fe49957
commit deb7e771aa

View File

@ -6,6 +6,9 @@ cargoBuildHook() {
runHook preBuild runHook preBuild
if [ ! -z "${buildAndTestSubdir-}" ]; then if [ ! -z "${buildAndTestSubdir-}" ]; then
# ensure the output doesn't end up in the subdirectory
export CARGO_TARGET_DIR="$(pwd)/target"
pushd "${buildAndTestSubdir}" pushd "${buildAndTestSubdir}"
fi fi