aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2019-10-08 11:30:52 +0200
committerWladimir J. van der Laan <laanwj@protonmail.com>2019-10-08 11:31:48 +0200
commit34919e00333f0e85c19819d18fd53ae5c7ff8855 (patch)
tree39850e9a34f3cbc0f9f7726c9b7e8ac903bf4f7d
parent2f174498d616b8aae585b7bb04adb2351ce40ca7 (diff)
parentddddd8961b6209cba1bcabad73916051a99f2025 (diff)
Merge #17011: ci: Use busybox utils for one build
ddddd8961b6209cba1bcabad73916051a99f2025 ci: Use busybox utils for one build (MarcoFalke) Pull request description: To make sure Bitcoin Core can be built with BusyBox, see https://github.com/bitcoin/bitcoin/pull/16927#issuecomment-536483706 ACKs for top commit: laanwj: ACK ddddd8961b6209cba1bcabad73916051a99f2025 Tree-SHA512: da3a4654ee7975206d04643675d309b4973a510ca344acaec97fb1ed19c43cf13489bdf236c92c4a90499ec5b3c18c3338fff096110b26abee5ffe955089f267
-rwxr-xr-xci/test/00_setup_env.sh2
-rw-r--r--ci/test/00_setup_env_arm.sh3
-rwxr-xr-xci/test/04_install.sh17
3 files changed, 18 insertions, 4 deletions
diff --git a/ci/test/00_setup_env.sh b/ci/test/00_setup_env.sh
index 94598835ac..8bc50da2c3 100755
--- a/ci/test/00_setup_env.sh
+++ b/ci/test/00_setup_env.sh
@@ -22,6 +22,8 @@ export MAKEJOBS=${MAKEJOBS:--j4}
# A folder for the ci system to put temporary files (ccache, datadirs for tests, ...)
export BASE_SCRATCH_DIR=${BASE_SCRATCH_DIR:-$BASE_ROOT_DIR/ci/scratch/}
export HOST=${HOST:-x86_64-unknown-linux-gnu}
+# Whether to prefer BusyBox over GNU utilities
+export USE_BUSY_BOX=${USE_BUSY_BOX:-false}
export RUN_UNIT_TESTS=${RUN_UNIT_TESTS:-true}
export RUN_FUNCTIONAL_TESTS=${RUN_FUNCTIONAL_TESTS:-true}
export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false}
diff --git a/ci/test/00_setup_env_arm.sh b/ci/test/00_setup_env_arm.sh
index ac7ace8c3b..db640015b1 100644
--- a/ci/test/00_setup_env_arm.sh
+++ b/ci/test/00_setup_env_arm.sh
@@ -7,7 +7,8 @@
export LC_ALL=C.UTF-8
export HOST=arm-linux-gnueabihf
-export PACKAGES="python3 g++-arm-linux-gnueabihf"
+export PACKAGES="python3 g++-arm-linux-gnueabihf busybox"
+export USE_BUSY_BOX=true
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
export GOAL="install"
diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh
index 4459d6f4ce..409e87ce04 100755
--- a/ci/test/04_install.sh
+++ b/ci/test/04_install.sh
@@ -33,18 +33,29 @@ if [ -z "$RUN_CI_ON_HOST" ]; then
DOCKER_ID=$(docker run $DOCKER_ADMIN -idt --mount type=bind,src=$BASE_BUILD_DIR,dst=$BASE_BUILD_DIR --mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR -w $BASE_BUILD_DIR --env-file /tmp/env $DOCKER_NAME_TAG)
DOCKER_EXEC () {
- docker exec $DOCKER_ID bash -c "cd $PWD && $*"
+ docker exec $DOCKER_ID bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $PWD && $*"
}
else
echo "Running on host system without docker wrapper"
DOCKER_EXEC () {
- bash -c "cd $PWD && $*"
+ bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $PWD && $*"
}
fi
DOCKER_EXEC free -m -h
-DOCKER_EXEC echo "Number of CPUs \(nproc\): $(nproc)"
+DOCKER_EXEC echo "Number of CPUs \(nproc\):" \$\(nproc\)
${CI_RETRY_EXE} DOCKER_EXEC apt-get update
${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $DOCKER_PACKAGES
+if [ "$USE_BUSY_BOX" = "true" ]; then
+ echo "Setup to use BusyBox utils"
+ DOCKER_EXEC mkdir -p $BASE_SCRATCH_DIR/bins/
+ # tar excluded for now because it requires passing in the exact archive type in ./depends (fixed in later BusyBox version)
+ # find excluded for now because it does not recognize the -delete option in ./depends (fixed in later BusyBox version)
+ # ar excluded for now because it does not recognize the -q option in ./depends (unknown if fixed)
+ # shellcheck disable=SC1010
+ 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
+ # Print BusyBox version
+ DOCKER_EXEC patch --help
+fi