From fa952acdb6ef1b07b7927202d1373fa7479fd5e4 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 17 Jan 2025 12:56:26 +0100 Subject: [PATCH] ci: Skip read-write of default env vars Also, set pipefail while touching the script. --- ci/test/02_run_container.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ci/test/02_run_container.sh b/ci/test/02_run_container.sh index 28d0898a4a5..c6edc9553cd 100755 --- a/ci/test/02_run_container.sh +++ b/ci/test/02_run_container.sh @@ -7,14 +7,12 @@ export LC_ALL=C.UTF-8 export CI_IMAGE_LABEL="bitcoin-ci-test" -set -ex +set -o errexit -o pipefail -o xtrace if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then # Export all env vars to avoid missing some. # Though, exclude those with newlines to avoid parsing problems. python3 -c 'import os; [print(f"{key}={value}") for key, value in os.environ.items() if "\n" not in value and "HOME" != key and "PATH" != key and "USER" != key]' | tee "/tmp/env-$USER-$CONTAINER_NAME" - # System-dependent env vars must be kept as is. So read them from the container. - docker run --platform="${CI_IMAGE_PLATFORM}" --rm "${CI_IMAGE_NAME_TAG}" bash -c "env | grep --extended-regexp '^(HOME|PATH|USER)='" | tee --append "/tmp/env-$USER-$CONTAINER_NAME" # Env vars during the build can not be changed. For example, a modified # $MAKEJOBS is ignored in the build process. Use --cpuset-cpus as an