0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

ci: Use busybox utils for one build

This commit is contained in:
MarcoFalke 2019-09-30 17:26:22 -04:00
parent bb83d23ad8
commit ddddd8961b
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
3 changed files with 18 additions and 4 deletions

View file

@ -22,6 +22,8 @@ export MAKEJOBS=${MAKEJOBS:--j4}
# A folder for the ci system to put temporary files (ccache, datadirs for tests, ...) # 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 BASE_SCRATCH_DIR=${BASE_SCRATCH_DIR:-$BASE_ROOT_DIR/ci/scratch/}
export HOST=${HOST:-x86_64-unknown-linux-gnu} 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_UNIT_TESTS=${RUN_UNIT_TESTS:-true}
export RUN_FUNCTIONAL_TESTS=${RUN_FUNCTIONAL_TESTS:-true} export RUN_FUNCTIONAL_TESTS=${RUN_FUNCTIONAL_TESTS:-true}
export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false} export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false}

View file

@ -7,7 +7,8 @@
export LC_ALL=C.UTF-8 export LC_ALL=C.UTF-8
export HOST=arm-linux-gnueabihf 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_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false export RUN_FUNCTIONAL_TESTS=false
export GOAL="install" export GOAL="install"

View file

@ -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_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 exec $DOCKER_ID bash -c "cd $PWD && $*" docker exec $DOCKER_ID bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $PWD && $*"
} }
else else
echo "Running on host system without docker wrapper" echo "Running on host system without docker wrapper"
DOCKER_EXEC () { DOCKER_EXEC () {
bash -c "cd $PWD && $*" bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $PWD && $*"
} }
fi fi
DOCKER_EXEC free -m -h 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 update
${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES $DOCKER_PACKAGES ${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -qq $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