5555 echo " Running on host system without docker wrapper"
5656fi
5757
58- DOCKER_EXEC () {
58+ CI_EXEC () {
5959 $DOCKER_CI_CMD_PREFIX bash -c " export PATH=$BASE_SCRATCH_DIR /bins/:\$ PATH && cd \" $P_CI_DIR \" && $* "
6060}
61- export -f DOCKER_EXEC
61+ export -f CI_EXEC
6262
6363if [ -n " $DPKG_ADD_ARCH " ]; then
64- DOCKER_EXEC dpkg --add-architecture " $DPKG_ADD_ARCH "
64+ CI_EXEC dpkg --add-architecture " $DPKG_ADD_ARCH "
6565fi
6666
6767if [[ $DOCKER_NAME_TAG == * centos* ]]; then
68- ${CI_RETRY_EXE} DOCKER_EXEC dnf -y install epel-release
69- ${CI_RETRY_EXE} DOCKER_EXEC dnf -y --allowerasing install " $DOCKER_PACKAGES " " $PACKAGES "
68+ ${CI_RETRY_EXE} CI_EXEC dnf -y install epel-release
69+ ${CI_RETRY_EXE} CI_EXEC dnf -y --allowerasing install " $DOCKER_PACKAGES " " $PACKAGES "
7070elif [ " $CI_USE_APT_INSTALL " != " no" ]; then
71- ${CI_RETRY_EXE} DOCKER_EXEC apt-get update
72- ${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y " $PACKAGES " " $DOCKER_PACKAGES "
71+ ${CI_RETRY_EXE} CI_EXEC apt-get update
72+ ${CI_RETRY_EXE} CI_EXEC apt-get install --no-install-recommends --no-upgrade -y " $PACKAGES " " $DOCKER_PACKAGES "
7373 if [ -n " $PIP_PACKAGES " ]; then
7474 # shellcheck disable=SC2086
7575 ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES
@@ -80,50 +80,50 @@ if [ "$CI_OS_NAME" == "macos" ]; then
8080 top -l 1 -s 0 | awk ' /PhysMem/ {print}'
8181 echo " Number of CPUs: $( sysctl -n hw.logicalcpu) "
8282else
83- DOCKER_EXEC free -m -h
84- DOCKER_EXEC echo " Number of CPUs \(nproc\):" \$\( nproc\)
85- DOCKER_EXEC echo " $( lscpu | grep Endian) "
83+ CI_EXEC free -m -h
84+ CI_EXEC echo " Number of CPUs \(nproc\):" \$\( nproc\)
85+ CI_EXEC echo " $( lscpu | grep Endian) "
8686fi
87- DOCKER_EXEC echo " Free disk space:"
88- DOCKER_EXEC df -h
87+ CI_EXEC echo " Free disk space:"
88+ CI_EXEC df -h
8989
9090if [ " $RUN_FUZZ_TESTS " = " true" ]; then
9191 export DIR_FUZZ_IN=${DIR_QA_ASSETS} /fuzz_seed_corpus/
9292 if [ ! -d " $DIR_FUZZ_IN " ]; then
93- DOCKER_EXEC git clone --depth=1 https://github.com/bitcoin-core/qa-assets " ${DIR_QA_ASSETS} "
93+ CI_EXEC git clone --depth=1 https://github.com/bitcoin-core/qa-assets " ${DIR_QA_ASSETS} "
9494 fi
9595elif [ " $RUN_UNIT_TESTS " = " true" ] || [ " $RUN_UNIT_TESTS_SEQUENTIAL " = " true" ]; then
9696 export DIR_UNIT_TEST_DATA=${DIR_QA_ASSETS} /unit_test_data/
9797 if [ ! -d " $DIR_UNIT_TEST_DATA " ]; then
98- DOCKER_EXEC mkdir -p " $DIR_UNIT_TEST_DATA "
99- DOCKER_EXEC curl --location --fail https://github.com/bitcoin-core/qa-assets/raw/main/unit_test_data/script_assets_test.json -o " ${DIR_UNIT_TEST_DATA} /script_assets_test.json"
98+ CI_EXEC mkdir -p " $DIR_UNIT_TEST_DATA "
99+ CI_EXEC curl --location --fail https://github.com/bitcoin-core/qa-assets/raw/main/unit_test_data/script_assets_test.json -o " ${DIR_UNIT_TEST_DATA} /script_assets_test.json"
100100 fi
101101fi
102102
103- DOCKER_EXEC mkdir -p " ${BASE_SCRATCH_DIR} /sanitizer-output/"
103+ CI_EXEC mkdir -p " ${BASE_SCRATCH_DIR} /sanitizer-output/"
104104
105105if [[ ${USE_MEMORY_SANITIZER} == " true" ]]; then
106- DOCKER_EXEC " update-alternatives --install /usr/bin/clang++ clang++ \$ (which clang++-9) 100"
107- DOCKER_EXEC " update-alternatives --install /usr/bin/clang clang \$ (which clang-9) 100"
108- DOCKER_EXEC " mkdir -p ${BASE_SCRATCH_DIR} /msan/build/"
109- DOCKER_EXEC " git clone --depth=1 https://github.com/llvm/llvm-project -b llvmorg-12.0.0 ${BASE_SCRATCH_DIR} /msan/llvm-project"
110- DOCKER_EXEC " cd ${BASE_SCRATCH_DIR} /msan/build/ && cmake -DLLVM_ENABLE_PROJECTS='libcxx;libcxxabi' -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_SANITIZER=Memory -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_TARGETS_TO_BUILD=X86 ../llvm-project/llvm/"
111- DOCKER_EXEC " cd ${BASE_SCRATCH_DIR} /msan/build/ && make $MAKEJOBS cxx"
106+ CI_EXEC " update-alternatives --install /usr/bin/clang++ clang++ \$ (which clang++-9) 100"
107+ CI_EXEC " update-alternatives --install /usr/bin/clang clang \$ (which clang-9) 100"
108+ CI_EXEC " mkdir -p ${BASE_SCRATCH_DIR} /msan/build/"
109+ CI_EXEC " git clone --depth=1 https://github.com/llvm/llvm-project -b llvmorg-12.0.0 ${BASE_SCRATCH_DIR} /msan/llvm-project"
110+ CI_EXEC " cd ${BASE_SCRATCH_DIR} /msan/build/ && cmake -DLLVM_ENABLE_PROJECTS='libcxx;libcxxabi' -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_SANITIZER=Memory -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_TARGETS_TO_BUILD=X86 ../llvm-project/llvm/"
111+ CI_EXEC " cd ${BASE_SCRATCH_DIR} /msan/build/ && make $MAKEJOBS cxx"
112112fi
113113
114114if [ -z " $DANGER_RUN_CI_ON_HOST " ]; then
115115 echo " Create $BASE_ROOT_DIR "
116- DOCKER_EXEC rsync -a /ro_base/ " $BASE_ROOT_DIR "
116+ CI_EXEC rsync -a /ro_base/ " $BASE_ROOT_DIR "
117117fi
118118
119119if [ " $USE_BUSY_BOX " = " true" ]; then
120120 echo " Setup to use BusyBox utils"
121- DOCKER_EXEC mkdir -p " ${BASE_SCRATCH_DIR} /bins/"
121+ CI_EXEC mkdir -p " ${BASE_SCRATCH_DIR} /bins/"
122122 # tar excluded for now because it requires passing in the exact archive type in ./depends (fixed in later BusyBox version)
123123 # find excluded for now because it does not recognize the -delete option in ./depends (fixed in later BusyBox version)
124124 # ar excluded for now because it does not recognize the -q option in ./depends (unknown if fixed)
125125 # shellcheck disable=SC1010
126- DOCKER_EXEC for util in \$\( busybox --list \| grep -v " ^ar$" \| grep -v " ^tar$" \| grep -v " ^find$" \)\; do ln -s \$\( command -v busybox\) " ${BASE_SCRATCH_DIR} /bins/\$ util" \; done
126+ CI_EXEC for util in \$\( busybox --list \| grep -v " ^ar$" \| grep -v " ^tar$" \| grep -v " ^find$" \)\; do ln -s \$\( command -v busybox\) " ${BASE_SCRATCH_DIR} /bins/\$ util" \; done
127127 # Print BusyBox version
128- DOCKER_EXEC patch --help
128+ CI_EXEC patch --help
129129fi
0 commit comments