Skip to content

Commit faba467

Browse files
author
MarcoFalke
committed
ci: Fix QEMU_USER_CMD parse issues
* Fix bash syntax by adding missing - * Disable QEMU_USER_CMD fallback when it is set Apparently bash can't distinguish an unset variable from a variable that is set to the empty string * Export the environment variable to the docker env, otherwise it couldn't be used there
1 parent fa5d709 commit faba467

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ci/test/00_setup_env_arm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8
99
export HOST=arm-linux-gnueabihf
1010
# The host arch is unknown, so we run the tests through qemu.
1111
# If the host is arm and wants to run the tests natively, it can set QEMU_USER_CMD to the empty string.
12-
export QEMU_USER_CMD="${QEMU_USER_CMD:"qemu-arm -L /usr/arm-linux-gnueabihf/"}"
12+
if [ -z ${QEMU_USER_CMD+x} ]; then export QEMU_USER_CMD="${QEMU_USER_CMD:-"qemu-arm -L /usr/arm-linux-gnueabihf/"}"; fi
1313
# We don't know whether the host can run the cross compiled binaries. To run them, either qemu-user or libc6:armhf for
1414
# the target is required, so install both.
1515
export DPKG_ADD_ARCH="armhf"

ci/test/00_setup_env_s390x.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8
99
export HOST=s390x-linux-gnu
1010
# The host arch is unknown, so we run the tests through qemu.
1111
# If the host is s390x and wants to run the tests natively, it can set QEMU_USER_CMD to the empty string.
12-
export QEMU_USER_CMD="${QEMU_USER_CMD:"qemu-s390x"}"
12+
if [ -z ${QEMU_USER_CMD+x} ]; then export QEMU_USER_CMD="${QEMU_USER_CMD:-"qemu-s390x"}"; fi
1313
export PACKAGES="python3-zmq bsdmainutils qemu-user"
1414
export RUN_UNIT_TESTS=true
1515
export RUN_FUNCTIONAL_TESTS=true

ci/test/04_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export ASAN_OPTIONS="detect_stack_use_after_return=1:check_initialization_order=
4141
export LSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/lsan"
4242
export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/tsan:log_path=${BASE_SCRATCH_DIR}/sanitizer-output/tsan"
4343
export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1"
44-
env | grep -E '^(BITCOIN_CONFIG|BASE_|CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS)' | tee /tmp/env
44+
env | grep -E '^(BITCOIN_CONFIG|BASE_|QEMU_|CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS)' | tee /tmp/env
4545
if [[ $HOST = *-mingw32 ]]; then
4646
DOCKER_ADMIN="--cap-add SYS_ADMIN"
4747
elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764)

0 commit comments

Comments
 (0)