From eeee02ea53dd1a3fb2eb62acd68fbd797d9b9ba8 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 29 Oct 2025 12:31:34 +0100 Subject: [PATCH] ci: Untangle CI_EXEC bash function It contains a large `bash -c` string, which is hard to parse. So pull out components: * CI_EXEC is only called with absolute folders as args, so the `cd` is not needed in CI_EXEC. It is only needed to specify the working dir of running the tests in 03_test_script.sh, so move it there. * The PATH modification is only needed after commit 4756114e505cff8848fb6344ef9a48d8822066c1 to check that depends does work properly, even when the PATH contains a space. * This allows to also drop the `bash -c` and use the proper and safer "$@" to forward args without the risk of word splitting. --- ci/test/02_run_container.sh | 2 +- ci/test/03_test_script.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/test/02_run_container.sh b/ci/test/02_run_container.sh index 77c70f82bfa..eac8a0e589c 100755 --- a/ci/test/02_run_container.sh +++ b/ci/test/02_run_container.sh @@ -13,7 +13,7 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then fi CI_EXEC () { - $CI_EXEC_CMD_PREFIX bash -c "export PATH=\"/path_with space:\$PATH\" && cd \"${BASE_ROOT_DIR}\" && $*" + $CI_EXEC_CMD_PREFIX "$@" } export -f CI_EXEC diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh index e61dc33edc9..39e13945e25 100755 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -8,6 +8,9 @@ export LC_ALL=C.UTF-8 set -ex +cd "${BASE_ROOT_DIR}" + +export PATH="/path_with space:${PATH}" export ASAN_OPTIONS="detect_leaks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1" export LSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/lsan" export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/tsan:halt_on_error=1:second_deadlock_stack=1"