Skip to content

Commit fad0b67

Browse files
author
MarcoFalke
committed
ci: Use qemu-user through container engine
1 parent 6243334 commit fad0b67

9 files changed

+18
-64
lines changed

.cirrus.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ persistent_worker_template_env: &PERSISTENT_WORKER_TEMPLATE_ENV
3030
#
3131
# The following specific types should exist, with the following requirements:
3232
# - lunar: For a machine running the Linux kernel shipped with Ubuntu Lunar 23.04. The machine is recommended to have 4 CPUs and 16 GB of memory.
33+
# - arm64: For an aarch64 machine, recommended to have 2 CPUs and 8 GB of memory.
3334
persistent_worker_template: &PERSISTENT_WORKER_TEMPLATE
3435
persistent_worker: {} # Only use this if the task does not care about the type at all
3536

@@ -206,13 +207,11 @@ task:
206207
task:
207208
name: 'ARM [unit tests, no functional tests] [bullseye]'
208209
<< : *GLOBAL_TASK_TEMPLATE
209-
container:
210-
docker_arguments:
211-
CI_IMAGE_NAME_TAG: debian:bullseye
212-
FILE_ENV: "./ci/test/00_setup_env_arm.sh"
213-
<< : *CREDITS_TEMPLATE
210+
persistent_worker:
211+
labels:
212+
type: arm64 # Use arm64 worker to sidestep qemu and avoid a slow CI: https://github.com/bitcoin/bitcoin/pull/28087#issuecomment-1649399453
214213
env:
215-
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
214+
FILE_ENV: "./ci/test/00_setup_env_arm.sh"
216215

217216
task:
218217
name: 'Win64 [unit tests, no gui tests, no boost::process, no functional tests] [jammy]'
@@ -230,7 +229,7 @@ task:
230229
<< : *GLOBAL_TASK_TEMPLATE
231230
container:
232231
docker_arguments:
233-
CI_IMAGE_NAME_TAG: quay.io/centos/centos:stream9
232+
CI_IMAGE_NAME_TAG: "quay.io/centos/amd64:stream9"
234233
FILE_ENV: "./ci/test/00_setup_env_i686_centos.sh"
235234
# For faster CI feedback, immediately schedule one task that runs all tests
236235
<< : *CREDITS_TEMPLATE
@@ -304,7 +303,7 @@ task:
304303
cpu: 4
305304
memory: 16G # The default memory is too small, so double everything
306305
docker_arguments:
307-
CI_IMAGE_NAME_TAG: ubuntu:focal
306+
CI_IMAGE_NAME_TAG: "docker.io/amd64/ubuntu:focal"
308307
FILE_ENV: "./ci/test/00_setup_env_i686_multiprocess.sh"
309308
env:
310309
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV

ci/test/00_setup_env.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ fi
3232
echo "Fallback to default values in env (if not yet set)"
3333
# The number of parallel jobs to pass down to make and test_runner.py
3434
export MAKEJOBS=${MAKEJOBS:--j4}
35-
# What host to compile for. See also ./depends/README.md
36-
# Tests that need cross-compilation export the appropriate HOST.
37-
# Tests that run natively guess the host
38-
export HOST=${HOST:-$("$BASE_ROOT_DIR/depends/config.guess")}
3935
# Whether to prefer BusyBox over GNU utilities
4036
export USE_BUSY_BOX=${USE_BUSY_BOX:-false}
4137

@@ -61,12 +57,12 @@ export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1}
6157
# This folder exists only on the ci guest, and on the ci host as a volume.
6258
export CCACHE_DIR=${CCACHE_DIR:-$BASE_SCRATCH_DIR/.ccache}
6359
# Folder where the build result is put (bin and lib).
64-
export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out/$HOST}
60+
export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out}
6561
# Folder where the build is done (dist and out-of-tree build).
6662
export BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_SCRATCH_DIR/build}
6763
# The folder for previous release binaries.
6864
# This folder exists only on the ci guest, and on the ci host as a volume.
69-
export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/releases/$HOST}
65+
export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/prev_releases}
7066
export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}
7167
export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates ccache python3 rsync git procps bison}
7268
export GOAL=${GOAL:-install}

ci/test/00_setup_env_arm.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,10 @@
77
export LC_ALL=C.UTF-8
88

99
export HOST=arm-linux-gnueabihf
10-
# The host arch is unknown, so we run the tests through qemu.
11-
# If the host is arm and wants to run the tests natively, it can set QEMU_USER_CMD to the empty string.
12-
if [ -z ${QEMU_USER_CMD+x} ]; then export QEMU_USER_CMD="${QEMU_USER_CMD:-"qemu-arm -L /usr/arm-linux-gnueabihf/"}"; fi
1310
export DPKG_ADD_ARCH="armhf"
1411
export PACKAGES="python3-zmq g++-arm-linux-gnueabihf busybox libc6:armhf libstdc++6:armhf libfontconfig1:armhf libxcb1:armhf"
15-
if [ -n "$QEMU_USER_CMD" ]; then
16-
# Likely cross-compiling, so install the needed gcc and qemu-user
17-
export PACKAGES="$PACKAGES qemu-user"
18-
fi
1912
export CONTAINER_NAME=ci_arm_linux
20-
# Use debian to avoid 404 apt errors when cross compiling
21-
export CI_IMAGE_NAME_TAG="debian:bullseye"
13+
export CI_IMAGE_NAME_TAG="docker.io/arm64v8/debian:bookworm"
2214
export USE_BUSY_BOX=true
2315
export RUN_UNIT_TESTS=true
2416
export RUN_FUNCTIONAL_TESTS=false

ci/test/00_setup_env_i686_centos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
88

99
export HOST=i686-pc-linux-gnu
1010
export CONTAINER_NAME=ci_i686_centos
11-
export CI_IMAGE_NAME_TAG="quay.io/centos/centos:stream9"
11+
export CI_IMAGE_NAME_TAG="quay.io/centos/amd64:stream9"
1212
export CI_BASE_PACKAGES="gcc-c++ glibc-devel.x86_64 libstdc++-devel.x86_64 glibc-devel.i686 libstdc++-devel.i686 ccache libtool make git python3 python3-pip which patch lbzip2 xz procps-ng dash rsync coreutils bison util-linux"
1313
export PIP_PACKAGES="pyzmq"
1414
export GOAL="install"

ci/test/00_setup_env_i686_multiprocess.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
88

99
export HOST=i686-pc-linux-gnu
1010
export CONTAINER_NAME=ci_i686_multiprocess
11-
export CI_IMAGE_NAME_TAG=ubuntu:20.04
11+
export CI_IMAGE_NAME_TAG="docker.io/amd64/ubuntu:20.04"
1212
export PACKAGES="cmake llvm clang g++-multilib"
1313
export DEP_OPTS="DEBUG=1 MULTIPROCESS=1"
1414
export GOAL="install"

ci/test/00_setup_env_s390x.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,9 @@
77
export LC_ALL=C.UTF-8
88

99
export HOST=s390x-linux-gnu
10-
# The host arch is unknown, so we run the tests through qemu.
11-
# If the host is s390x and wants to run the tests natively, it can set QEMU_USER_CMD to the empty string.
12-
if [ -z ${QEMU_USER_CMD+x} ]; then export QEMU_USER_CMD="${QEMU_USER_CMD:-"qemu-s390x"}"; fi
1310
export PACKAGES="python3-zmq"
14-
if [ -n "$QEMU_USER_CMD" ]; then
15-
# Likely cross-compiling, so install the needed gcc and qemu-user
16-
export DPKG_ADD_ARCH="s390x"
17-
export PACKAGES="$PACKAGES g++-s390x-linux-gnu qemu-user libc6:s390x libstdc++6:s390x"
18-
fi
19-
# Use debian to avoid 404 apt errors
2011
export CONTAINER_NAME=ci_s390x
21-
export CI_IMAGE_NAME_TAG="debian:bookworm"
12+
export CI_IMAGE_NAME_TAG="docker.io/s390x/debian:bookworm"
2213
export TEST_RUNNER_ENV="LC_ALL=C"
2314
export TEST_RUNNER_EXTRA="--exclude feature_init,rpc_bind,feature_bind_extra" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
2415
export RUN_FUNCTIONAL_TESTS=true

ci/test/04_install.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66

77
export LC_ALL=C.UTF-8
88

9-
if [[ $QEMU_USER_CMD == qemu-s390* ]]; then
10-
export LC_ALL=C
11-
fi
12-
139
# Create folders that are mounted into the docker
1410
mkdir -p "${CCACHE_DIR}"
1511
mkdir -p "${PREVIOUS_RELEASES_DIR}"

ci/test/06_script_b.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ fi
1919
echo "Free disk space:"
2020
df -h
2121

22+
# What host to compile for. See also ./depends/README.md
23+
# Tests that need cross-compilation export the appropriate HOST.
24+
# Tests that run natively guess the host
25+
export HOST=${HOST:-$("$BASE_ROOT_DIR/depends/config.guess")}
26+
2227
if [ "$RUN_FUZZ_TESTS" = "true" ]; then
2328
export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/
2429
if [ ! -d "$DIR_FUZZ_IN" ]; then
@@ -124,13 +129,6 @@ if [[ $HOST = *-mingw32 ]]; then
124129
"${BASE_ROOT_DIR}/ci/test/wrap-wine.sh"
125130
fi
126131

127-
if [ -n "$QEMU_USER_CMD" ]; then
128-
# Generate all binaries, so that they can be wrapped
129-
make "$MAKEJOBS" -C src/secp256k1 VERBOSE=1
130-
make "$MAKEJOBS" -C src minisketch/test VERBOSE=1
131-
"${BASE_ROOT_DIR}/ci/test/wrap-qemu.sh"
132-
fi
133-
134132
if [ -n "$USE_VALGRIND" ]; then
135133
"${BASE_ROOT_DIR}/ci/test/wrap-valgrind.sh"
136134
fi

ci/test/wrap-qemu.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)