Skip to content

Commit 34919e0

Browse files
committed
Merge bitcoin#17011: ci: Use busybox utils for one build
ddddd89 ci: Use busybox utils for one build (MarcoFalke) Pull request description: To make sure Bitcoin Core can be built with BusyBox, see bitcoin#16927 (comment) ACKs for top commit: laanwj: ACK ddddd89 Tree-SHA512: da3a4654ee7975206d04643675d309b4973a510ca344acaec97fb1ed19c43cf13489bdf236c92c4a90499ec5b3c18c3338fff096110b26abee5ffe955089f267
2 parents 2f17449 + ddddd89 commit 34919e0

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

Diff for: ci/test/00_setup_env.sh

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export MAKEJOBS=${MAKEJOBS:--j4}
2222
# A folder for the ci system to put temporary files (ccache, datadirs for tests, ...)
2323
export BASE_SCRATCH_DIR=${BASE_SCRATCH_DIR:-$BASE_ROOT_DIR/ci/scratch/}
2424
export HOST=${HOST:-x86_64-unknown-linux-gnu}
25+
# Whether to prefer BusyBox over GNU utilities
26+
export USE_BUSY_BOX=${USE_BUSY_BOX:-false}
2527
export RUN_UNIT_TESTS=${RUN_UNIT_TESTS:-true}
2628
export RUN_FUNCTIONAL_TESTS=${RUN_FUNCTIONAL_TESTS:-true}
2729
export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false}

Diff for: ci/test/00_setup_env_arm.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
export LC_ALL=C.UTF-8
88

99
export HOST=arm-linux-gnueabihf
10-
export PACKAGES="python3 g++-arm-linux-gnueabihf"
10+
export PACKAGES="python3 g++-arm-linux-gnueabihf busybox"
11+
export USE_BUSY_BOX=true
1112
export RUN_UNIT_TESTS=false
1213
export RUN_FUNCTIONAL_TESTS=false
1314
export GOAL="install"

Diff for: ci/test/04_install.sh

+14-3
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,29 @@ if [ -z "$RUN_CI_ON_HOST" ]; then
3333
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)
3434

3535
DOCKER_EXEC () {
36-
docker exec $DOCKER_ID bash -c "cd $PWD && $*"
36+
docker exec $DOCKER_ID bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $PWD && $*"
3737
}
3838
else
3939
echo "Running on host system without docker wrapper"
4040
DOCKER_EXEC () {
41-
bash -c "cd $PWD && $*"
41+
bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $PWD && $*"
4242
}
4343
fi
4444

4545
DOCKER_EXEC free -m -h
46-
DOCKER_EXEC echo "Number of CPUs \(nproc\): $(nproc)"
46+
DOCKER_EXEC echo "Number of CPUs \(nproc\):" \$\(nproc\)
4747

4848
${CI_RETRY_EXE} DOCKER_EXEC apt-get update
4949
${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $DOCKER_PACKAGES
5050

51+
if [ "$USE_BUSY_BOX" = "true" ]; then
52+
echo "Setup to use BusyBox utils"
53+
DOCKER_EXEC mkdir -p $BASE_SCRATCH_DIR/bins/
54+
# tar excluded for now because it requires passing in the exact archive type in ./depends (fixed in later BusyBox version)
55+
# find excluded for now because it does not recognize the -delete option in ./depends (fixed in later BusyBox version)
56+
# ar excluded for now because it does not recognize the -q option in ./depends (unknown if fixed)
57+
# shellcheck disable=SC1010
58+
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
59+
# Print BusyBox version
60+
DOCKER_EXEC patch --help
61+
fi

0 commit comments

Comments
 (0)