From 3031b6edd493d53294bc50989ac86ea033f2395d Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 16 Sep 2023 12:51:14 -0400 Subject: [PATCH] Support arbitrary relative paths for setupfiles in run_docker_compare script. --- scripts/run_docker_compare.bash | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/run_docker_compare.bash b/scripts/run_docker_compare.bash index 309cddf..019a98a 100755 --- a/scripts/run_docker_compare.bash +++ b/scripts/run_docker_compare.bash @@ -37,7 +37,8 @@ function launch_container { fi if [ "$SHELL" != "YES" ]; then - local features_joined=$(IFS=","; echo "${features[*]}") + local features_joined + features_joined=$(IFS=","; echo "${features[*]}") additional_args+=(cargo run --bin compare --no-default-features --features "$features_joined") additional_flags+=(--read-only) else @@ -52,10 +53,9 @@ function launch_container { if [ $# -gt 0 ]; then # If we passed in args, we need to forward them along for path in "${@}"; do - local full_path=$($REALPATH "$path") - local containing_folder=$(dirname "$full_path") - local file_name=$(basename "$full_path") - docker run "${additional_flags[@]}" --init --rm -i --mount type=tmpfs,destination=/tmp -v "${containing_folder}:/input:ro" -v "$($REALPATH "$DIR/../"):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source --entrypoint "" organic-test "${additional_args[@]}" -- "/input/$file_name" + local full_path + full_path=$($REALPATH "$path") + docker run "${additional_flags[@]}" --init --rm -i --mount type=tmpfs,destination=/tmp -v "/:/input:ro" -v "$($REALPATH "$DIR/../"):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source --entrypoint "" organic-test "${additional_args[@]}" -- "/input${full_path}" done else docker run "${additional_flags[@]}" --init --rm -i --mount type=tmpfs,destination=/tmp -v "$($REALPATH "$DIR/../"):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source --entrypoint "" organic-test "${additional_args[@]}"