ci: Supply --platform argument to docker commands. #31657

pull davidgumberg wants to merge 1 commits into bitcoin:master from davidgumberg:1-13-24-ci-fix changing 6 files +14 −5
  1. davidgumberg commented at 11:17 pm on January 14, 2025: contributor

    I ran into this issue when following the instructions in ci/README.md for running CI locally.

    Newer versions of docker require a --platform argument when building from a platform-specific image that differs from the host platform, I’m not sure when this change took place, but trying to build any of the cross-platform CI images on Docker 27.5.0 fails in the following manner:

     0$ # From ci/README.md
     1$ env -i HOME="$HOME" PATH="$PATH" USER="$USER" bash -c 'FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh'
     2WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested
     3Creating docker.io/arm64v8/debian:bookworm container to run in
     4+ docker build --file $BITCOIN_SRC/ci/test_imagefile --build-arg CI_IMAGE_NAME_TAG=docker.io/arm64v8/debian:bookworm --build-arg FILE_ENV=./ci/test/00_setup_env_arm.sh --label=bitcoin-ci-test --tag=ci_arm_linux $BITCOIN_SRC
     5[+] Building 0.6s (2/2) FINISHED                                                                                                                                                 docker:default
     6 => [internal] load build definition from test_imagefile                                                                                                                                   0.0s
     7 => => transferring dockerfile: 600B                                                                                                                                                       0.0s
     8 => WARN: InvalidDefaultArgInFrom: Default value for ARG ${CI_IMAGE_NAME_TAG} results in empty or invalid base image name (line 8)                                                         0.0s
     9 => ERROR [internal] load metadata for docker.io/arm64v8/debian:bookworm                                                                                                                   0.5s
    10------
    11 > [internal] load metadata for docker.io/arm64v8/debian:bookworm:
    12------
    13
    14 1 warning found (use docker --debug to expand):
    15 - InvalidDefaultArgInFrom: Default value for ARG ${CI_IMAGE_NAME_TAG} results in empty or invalid base image name (line 8)
    16test_imagefile:8
    17--------------------
    18   6 |
    19   7 |     ARG CI_IMAGE_NAME_TAG
    20   8 | >>> FROM ${CI_IMAGE_NAME_TAG}
    21   9 |
    22  10 |     ARG FILE_ENV
    23--------------------
    24ERROR: failed to solve: docker.io/arm64v8/debian:bookworm: failed to resolve source metadata for docker.io/arm64v8/debian:bookworm: no match for platform in manifest: not found
    

    This branch fixes this by setting the --platform argument of docker build and docker run with an environment variable CI_IMAGE_PLATFORM for each platform specific job, and linux/{$cpuarch} for any native jobs.

    Thi

    Steps to reproduce

    1. Install relevant dependencies, on Ubuntu:
    0sudo apt install bash docker.io python3 qemu-user-static
    
    1. Run one of the platform-specific CI images, e.g.:
    0env -i HOME="$HOME" PATH="$PATH" USER="$USER" bash -c 'FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh'
    
  2. DrahtBot commented at 11:17 pm on January 14, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31657.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, hebasto

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31678 (ci: Skip read-write of default env vars by maflcko)
    • #30975 (Add multiprocess binaries to release build (except Windows, OpenBSD) by Sjors)
    • #29881 (guix: use GCC 13 to build releases by fanquake)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. DrahtBot added the label Tests on Jan 14, 2025
  4. in ci/test/00_setup_env_s390x.sh:12 in e58e0c52e0 outdated
     9@@ -10,6 +10,7 @@ export HOST=s390x-linux-gnu
    10 export PACKAGES="python3-zmq"
    11 export CONTAINER_NAME=ci_s390x
    12 export CI_IMAGE_NAME_TAG="docker.io/s390x/ubuntu:24.04"
    


    maflcko commented at 9:57 am on January 15, 2025:
    0export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04"
    

    nit: I think you can now remove the redundant arch here? (same for the others)


    davidgumberg commented at 0:02 am on January 16, 2025:
    Thanks, done.
  5. in ci/test/00_setup_env_s390x.sh:13 in e58e0c52e0 outdated
     9@@ -10,6 +10,7 @@ export HOST=s390x-linux-gnu
    10 export PACKAGES="python3-zmq"
    11 export CONTAINER_NAME=ci_s390x
    12 export CI_IMAGE_NAME_TAG="docker.io/s390x/ubuntu:24.04"
    13+export DOCKER_DEFAULT_PLATFORM="linux/s390x"
    


    maflcko commented at 10:07 am on January 15, 2025:

    Does this env var work for podman as well? Regardless, I am wondering if it was easier to just pass --platform to docker build in ./ci/test/02_run_container.sh (and possibly docker run, if needed)?

    Something like:

    0CI_IMAGE_PLATFORM=""  # native platform (default)
    

    Alternatively, with the added benefit of possibly supporting macos (see #31344 (comment) (expand “docker setup”)):

    0CI_IMAGE_PLATFORM="--os linux"  # native arch (default)
    

    and then in the individual CI tasks:

    0CI_IMAGE_PLATFORM="--platform=linux/s390x"
    

    davidgumberg commented at 8:08 pm on January 15, 2025:

    Does this env var work for podman as well?

    The “podman” cli frontend doesn’t use this environment variable1, but I tested locally (on Fedora 40) that this PR works for the build phase when using docker cli to interact with podman container host:

    0$ sudo dnf install podman-machine
    1$ podman machine init
    2$ podman machine start
    3Starting machine "podman-machine-default"
    4API forwarding listening on: /run/user/1000/podman/podman-machine-default-api.sock
    5$ env -i HOME="$HOME" PATH="$PATH" USER="$USER" DOCKER_HOST='unix:///run/user/1000/podman/podman-machine-default-api.sock' bash -c 'FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh'
    6WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
    

    but as the warning hints will later fail when the docker run command is reached:

    0++ docker run --cap-add LINUX_IMMUTABLE --rm --interactive --detach --tty --mount [etc...] --env-file /tmp/env-{USER}-ci_arm_linux --name ci_arm_linux --network ci-ip6net ci_arm_linux
    1Unable to find image 'ci_arm_linux:latest' locally
    2$ cat /tmp/env-{USER}-ci_arm_linux | grep "DOCKER_HOST"
    3DOCKER_HOST=unix:///run/user/1000/podman/podman-machine-default-api.sock
    

    but this can be fixed with:

    0--- a/ci/test/02_run_container.sh
    1+++ b/ci/test/02_run_container.sh
    2@@ -34,6 +34,7 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
    3       --label="${CI_IMAGE_LABEL}" \
    4       --tag="${CONTAINER_NAME}" \
    5+      --load \
    

    Alternatively, with the added benefit of possibly supporting macos (see #31344 (comment) (expand “docker setup”)):

    0CI_IMAGE_PLATFORM="--os linux"  # native arch (default)
    

    podman allows splitting up --platform into --arch and --os but docker doesn’t :

    0$ docker build --os linux
    1unknown flag: --os
    2$ docker build --arch s390x
    3unknown flag: --arch
    

    I will try to troubleshoot what works best on an arm macos machine later today, but I guess the approach you are suggesting may work better if we ever want to support using podman for build and run.


    davidgumberg commented at 0:03 am on January 16, 2025:
    How to best make this compatible with podman and/or macos remains an open question, but I’ve switched to using CI_IMAGE_PLATFORM that gets passed to docker build and docker run as you suggested

    davidgumberg commented at 10:28 pm on January 16, 2025:
    Marking this as resolved since my latest push tries to set the right native “–platform=linux/{arch}”, falling back to “–platform=linux” which is also valid according to docker’s documentation although I haven’t tested this yet.
  6. maflcko approved
  7. maflcko commented at 10:07 am on January 15, 2025: member
    lgtm, but I left some feedback
  8. davidgumberg force-pushed on Jan 15, 2025
  9. davidgumberg renamed this:
    ci: Supply `--platform` argument to `docker build`.
    ci: Supply `--platform` argument to `docker` commands.
    on Jan 16, 2025
  10. davidgumberg commented at 0:05 am on January 16, 2025: contributor
    Rebased to address feedback, removed redundant arch specification from image names and switched to using the --platform argument over the DOCKER_DEFAULT_PLATFORM environment variable.
  11. davidgumberg force-pushed on Jan 16, 2025
  12. DrahtBot added the label CI failed on Jan 16, 2025
  13. DrahtBot commented at 0:14 am on January 16, 2025: contributor

    🚧 At least one of the CI tasks failed. Debug: https://github.com/bitcoin/bitcoin/runs/35684658943

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  14. DrahtBot removed the label CI failed on Jan 16, 2025
  15. in ci/test/02_run_container.sh:17 in 3f6863b745 outdated
    13@@ -14,7 +14,7 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
    14   # Though, exclude those with newlines to avoid parsing problems.
    15   python3 -c 'import os; [print(f"{key}={value}") for key, value in os.environ.items() if "\n" not in value and "HOME" != key and "PATH" != key and "USER" != key]' | tee "/tmp/env-$USER-$CONTAINER_NAME"
    16   # System-dependent env vars must be kept as is. So read them from the container.
    17-  docker run --rm "${CI_IMAGE_NAME_TAG}" bash -c "env | grep --extended-regexp '^(HOME|PATH|USER)='" | tee --append "/tmp/env-$USER-$CONTAINER_NAME"
    18+  docker run "$CI_IMAGE_PLATFORM" --rm "${CI_IMAGE_NAME_TAG}" bash -c "env | grep --extended-regexp '^(HOME|PATH|USER)='" | tee --append "/tmp/env-$USER-$CONTAINER_NAME"
    


    maflcko commented at 9:47 am on January 16, 2025:

    The last push wasn’t correct. This will fail https://cirrus-ci.com/task/4983203259219968?logs=ci#L194:

    0[19:46:15.608] + docker run '' --rm docker.io/ubuntu:24.04 bash -c 'env | grep --extended-regexp '\''^(HOME|PATH|USER)='\'''
    1[19:46:15.608] + tee --append /tmp/env-ci_worker_1731482059_419572074-ci_native_fuzz
    2[19:46:15.610] Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
    3[19:46:15.688] Error: repository name must have at least one component
    

    I guess pipefail should be enabled.

    Also, I wonder why the CI passed when this line was effectively disabled. Looking at #28138#issue-1818409930, I presume this will be failing when running the CI in a Fedora box.


    davidgumberg commented at 10:11 pm on January 16, 2025:

    The last push wasn’t correct. This will fail

    Thanks for catching, I did this because without quotes the linter complains about SC2086: https://www.shellcheck.net/wiki/SC2086 and I didn’t test any images built with the default CI_IMAGE_PLATFORM value.

    I am trying to use the native platform by default now in the latest push

    Don’t fully grasp the context of #28138 but native_nowallet_libbitcoinkernel

     0$ env -i HOME="$HOME" PATH="$PATH" USER="$USER" bash -c 'FILE_ENV="./ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh" ./ci/test_run_all.sh'
     1# [...]
     2+ docker run '' --rm docker.io/ubuntu:22.04 bash -c 'env | grep --extended-regexp '\''^(HOME|PATH|USER)='\'''
     3+ tee --append /tmp/env-ltime-ci_native_previous_releases
     4docker: invalid reference format.
     5See 'docker run --help'.
     6# [...]
     7+ ctest --stop-on-failure -j4 --timeout 2400
     8Test project /ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu
     9100% tests passed, 0 tests failed out of 124
    10+ test/functional/test_runner.py --ci -j4 --tmpdirprefix /ci_container_base/ci/scratch/test_runner/ --ansi --combinedlogslen=99999999 --timeout-factor=40 --quiet --failfast
    11ALL                                                      | ✓ Passed  | 1600 s (accumulated)
    

    I guess pipefail should be enabled.

    +1


    maflcko commented at 9:01 am on January 17, 2025:

    Don’t fully grasp the context of #28138 but native_nowallet_libbitcoinkernel

    If it is no longer happening, I guess the workaround can be removed.


    maflcko commented at 12:13 pm on January 17, 2025:
  16. maflcko commented at 9:47 am on January 16, 2025: member
    lgtm, but you’ll have to undo the last force-push
  17. in ci/test/00_setup_env.sh:73 in 3f6863b745 outdated
    67@@ -68,3 +68,6 @@ export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential pkg-config curl ca-c
    68 export GOAL=${GOAL:-install}
    69 export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets}
    70 export CI_RETRY_EXE=${CI_RETRY_EXE:-"retry --"}
    71+
    72+# The --platform argument used with `docker build` and `docker run`.
    73+export CI_IMAGE_PLATFORM=${CI_IMAGE_PLATFORM} # native platform by default
    


    maflcko commented at 9:51 am on January 16, 2025:

    style wise I don’t like using unbounded vars as fallbacks for an empty string. Might as well just set the empty string explicitly?

    Ref:

    0sh-5.1# set -o nounset
    1sh-5.1# export CI_IMAGE_PLATFORM=${CI_IMAGE_PLATFORM}
    2sh: CI_IMAGE_PLATFORM: unbound variable
    3sh-5.1# 
    

    davidgumberg commented at 10:11 pm on January 16, 2025:
    Thanks, fixed with a different approach.
  18. maflcko commented at 9:52 am on January 16, 2025: member
    (In the pull description you can also remove the struck out stuff, so that it does not end up in the merge commit)
  19. davidgumberg force-pushed on Jan 16, 2025
  20. davidgumberg force-pushed on Jan 16, 2025
  21. DrahtBot added the label CI failed on Jan 16, 2025
  22. davidgumberg force-pushed on Jan 16, 2025
  23. davidgumberg force-pushed on Jan 16, 2025
  24. in ci/test/00_setup_env.sh:72 in e1c7c29727 outdated
    67@@ -68,3 +68,16 @@ export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential pkg-config curl ca-c
    68 export GOAL=${GOAL:-install}
    69 export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets}
    70 export CI_RETRY_EXE=${CI_RETRY_EXE:-"retry --"}
    71+
    72+# Try to get he host architecture in GOARCH format.
    


    davidgumberg commented at 10:14 pm on January 16, 2025:
    typo in this comment, I’ll fix if I retouch
  25. davidgumberg commented at 10:19 pm on January 16, 2025: contributor

    Rebased to incorporate feedback, now try to set a good default --platform linux/$arch which should be an improvement for running CI on macOS.

    This solution also avoids an issue I ran into after making the image tags less specific, which is that if no --platform argument is set, docker will try to use any image that it has cached before fetching a native image.

  26. DrahtBot removed the label CI failed on Jan 17, 2025
  27. in ci/test/00_setup_env.sh:83 in e1c7c29727 outdated
    78+    NATIVE_PLATFORM="linux/$(go env GOARCH)"
    79+else
    80+    NATIVE_PLATFORM="linux"
    81+fi
    82+# The --platform argument used with `docker build` and `docker run`.
    83+export CI_IMAGE_PLATFORM=${CI_IMAGE_PLATFORM:-$NATIVE_PLATFORM} # native platform by default
    


    maflcko commented at 8:54 am on January 17, 2025:

    Why the code above? Seems easier to just force “linux” (the fallback/default), which documents the requirements. It seems to work with podman, and I presume also works for the others?

    0export CI_IMAGE_PLATFORM=${CI_IMAGE_PLATFORM:-"linux"} # Force linux, but use native arch by default
    

    davidgumberg commented at 6:38 pm on January 17, 2025:

    The reason I did this was because of the caching issue I described above which can be reproduced as follows with a clean docker cache:

     0$ # clean docker cache on fedora 40
     1$ systemctl restart docker 
     2$ docker system prune -a
     3
     4$ docker run --platform=s390x docker.io/ubuntu:24.04 bash -c 'uname -m'
     5Unable to find image 'ubuntu:24.04' locally
     624.04: Pulling from library/ubuntu
     7755503a8fb36: Pull complete
     8Digest: sha256:80dd3c3b9c6cecb9f1667e9290b3bc61b78c2678c02cbdae5f0fea92cc6734ab
     9Status: Downloaded newer image for ubuntu:24.04
    10s390x
    11$ docker run docker.io/ubuntu:24.04 bash -c 'uname -m' # no platform argument specified
    12WARNING: The requested image's platform (linux/s390x) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested
    13s390x
    

    but it seems docker infers the arch if an OS is specified, and doesn’t just fall back on a cache hit for that OS:

    0$ docker run --platform=linux docker.io/ubuntu:24.04 bash -c 'uname -m'
    1Unable to find image 'ubuntu:24.04' locally
    224.04: Pulling from library/ubuntu
    3de44b265507a: Pull complete
    4Digest: sha256:80dd3c3b9c6cecb9f1667e9290b3bc61b78c2678c02cbdae5f0fea92cc6734ab
    5Status: Downloaded newer image for ubuntu:24.04
    6x86_64
    

    So I’ve taken your suggestion.


    maflcko commented at 8:24 am on January 20, 2025:

    but it seems docker infers the arch if an OS is specified, and doesn’t just fall back on a cache hit for that OS:

    Thanks for checking! In case this ever changes, it should be trivial to re-add the code you wrote by re-applying the diff: https://github.com/bitcoin/bitcoin/compare/1299bd89f8661028f9e1826c51a29d4e3fe39cdc..e1c7c29727faf2d0a5c6fa01505418aac26958fe

  28. maflcko approved
  29. maflcko commented at 8:56 am on January 17, 2025: member

    lgtm ACK e1c7c29727faf2d0a5c6fa01505418aac26958fe

    I think some code can be removed to be more streamlined, but not a blocker.

  30. DrahtBot added the label Needs rebase on Jan 17, 2025
  31. davidgumberg force-pushed on Jan 17, 2025
  32. ci: Supply `platform` argument to docker commands.
    Later versions of docker require a `--platform` argument when building
    and running from a platform-specific image that differs from the host
    platform.
    6e29de2101
  33. davidgumberg force-pushed on Jan 17, 2025
  34. DrahtBot removed the label Needs rebase on Jan 17, 2025
  35. davidgumberg commented at 9:56 pm on January 17, 2025: contributor
    rebased to address merge conflicts and dropped unnecessary logic for getting the host machine arch.
  36. maflcko commented at 8:39 am on January 20, 2025: member
    lgtm ACK 6e29de21010fc5213176a6ba29f754ca72612ea0
  37. hebasto commented at 8:55 am on January 20, 2025: member

    Tested 6e29de21010fc5213176a6ba29f754ca72612ea0 on Ubuntu 24.10:

      0$ docker --version
      1Docker version 27.1.1, build 6312585
      2$ env -i HOME="$HOME" PATH="$PATH" USER="$USER" bash -c 'FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh'
      3++++ dirname ./ci/test/00_setup_env.sh
      4+++ cd ./ci/test/../../
      5+++ pwd
      6++ BASE_READ_ONLY_DIR=/home/hebasto/git/bitcoin
      7++ export BASE_READ_ONLY_DIR
      8++ export BASE_ROOT_DIR=/ci_container_base
      9++ BASE_ROOT_DIR=/ci_container_base
     10++ export DEPENDS_DIR=/ci_container_base/depends
     11++ DEPENDS_DIR=/ci_container_base/depends
     12++ export BASE_SCRATCH_DIR=/ci_container_base/ci/scratch
     13++ BASE_SCRATCH_DIR=/ci_container_base/ci/scratch
     14++ export BINS_SCRATCH_DIR=/ci_container_base/ci/scratch/bins/
     15++ BINS_SCRATCH_DIR=/ci_container_base/ci/scratch/bins/
     16++ echo 'Setting specific values in env'
     17Setting specific values in env
     18++ '[' -n ./ci/test/00_setup_env_arm.sh ']'
     19++ set -o errexit
     20++ source ./ci/test/00_setup_env_arm.sh
     21+++ export LC_ALL=C.UTF-8
     22+++ LC_ALL=C.UTF-8
     23+++ export HOST=arm-linux-gnueabihf
     24+++ HOST=arm-linux-gnueabihf
     25+++ export DPKG_ADD_ARCH=armhf
     26+++ DPKG_ADD_ARCH=armhf
     27+++ export 'PACKAGES=python3-zmq g++-arm-linux-gnueabihf busybox libc6:armhf libstdc++6:armhf libfontconfig1:armhf libxcb1:armhf'
     28+++ PACKAGES='python3-zmq g++-arm-linux-gnueabihf busybox libc6:armhf libstdc++6:armhf libfontconfig1:armhf libxcb1:armhf'
     29+++ export CONTAINER_NAME=ci_arm_linux
     30+++ CONTAINER_NAME=ci_arm_linux
     31+++ export CI_IMAGE_NAME_TAG=docker.io/debian:bookworm
     32+++ CI_IMAGE_NAME_TAG=docker.io/debian:bookworm
     33+++ export CI_IMAGE_PLATFORM=linux/arm64
     34+++ CI_IMAGE_PLATFORM=linux/arm64
     35+++ export USE_BUSY_BOX=true
     36+++ USE_BUSY_BOX=true
     37+++ export RUN_UNIT_TESTS=true
     38+++ RUN_UNIT_TESTS=true
     39+++ export RUN_FUNCTIONAL_TESTS=false
     40+++ RUN_FUNCTIONAL_TESTS=false
     41+++ export GOAL=install
     42+++ GOAL=install
     43+++ export 'BITCOIN_CONFIG=-DREDUCE_EXPORTS=ON -DCMAKE_CXX_FLAGS='\''-Wno-psabi -Wno-error=maybe-uninitialized'\'''
     44+++ BITCOIN_CONFIG='-DREDUCE_EXPORTS=ON -DCMAKE_CXX_FLAGS='\''-Wno-psabi -Wno-error=maybe-uninitialized'\'''
     45++ echo 'Fallback to default values in env (if not yet set)'
     46Fallback to default values in env (if not yet set)
     47++ export MAKEJOBS=-j4
     48++ MAKEJOBS=-j4
     49++ export USE_BUSY_BOX=true
     50++ USE_BUSY_BOX=true
     51++ export RUN_UNIT_TESTS=true
     52++ RUN_UNIT_TESTS=true
     53++ export RUN_FUNCTIONAL_TESTS=false
     54++ RUN_FUNCTIONAL_TESTS=false
     55++ export RUN_TIDY=false
     56++ RUN_TIDY=false
     57++ export TEST_RUNNER_TIMEOUT_FACTOR=40
     58++ TEST_RUNNER_TIMEOUT_FACTOR=40
     59++ export RUN_FUZZ_TESTS=false
     60++ RUN_FUZZ_TESTS=false
     61++ export BOOST_TEST_RANDOM=1
     62++ BOOST_TEST_RANDOM=1
     63++ export DEBIAN_FRONTEND=noninteractive
     64++ DEBIAN_FRONTEND=noninteractive
     65++ export CCACHE_MAXSIZE=500M
     66++ CCACHE_MAXSIZE=500M
     67++ export CCACHE_TEMPDIR=/tmp/.ccache-temp
     68++ CCACHE_TEMPDIR=/tmp/.ccache-temp
     69++ export CCACHE_COMPRESS=1
     70++ CCACHE_COMPRESS=1
     71++ export CCACHE_DIR=/ci_container_base/ci/scratch/ccache
     72++ CCACHE_DIR=/ci_container_base/ci/scratch/ccache
     73++ export BASE_OUTDIR=/ci_container_base/ci/scratch/out
     74++ BASE_OUTDIR=/ci_container_base/ci/scratch/out
     75++ export PREVIOUS_RELEASES_DIR=/ci_container_base/prev_releases
     76++ PREVIOUS_RELEASES_DIR=/ci_container_base/prev_releases
     77++ export 'CI_BASE_PACKAGES=build-essential pkgconf curl ca-certificates ccache python3 rsync git procps bison e2fsprogs cmake'
     78++ CI_BASE_PACKAGES='build-essential pkgconf curl ca-certificates ccache python3 rsync git procps bison e2fsprogs cmake'
     79++ export GOAL=install
     80++ GOAL=install
     81++ export DIR_QA_ASSETS=/ci_container_base/ci/scratch/qa-assets
     82++ DIR_QA_ASSETS=/ci_container_base/ci/scratch/qa-assets
     83++ export 'CI_RETRY_EXE=retry --'
     84++ CI_RETRY_EXE='retry --'
     85++ export CI_IMAGE_PLATFORM=linux/arm64
     86++ CI_IMAGE_PLATFORM=linux/arm64
     87+ set -o errexit
     88+ ./ci/test/02_run_container.sh
     89+ '[' -z '' ']'
     90+ python3 -c 'import os; [print(f"{key}={value}") for key, value in os.environ.items() if "\n" not in value and "HOME" != key and "PATH" != key and "USER" != key]'
     91+ tee /tmp/env-hebasto-ci_arm_linux
     92CCACHE_TEMPDIR=/tmp/.ccache-temp
     93FILE_ENV=./ci/test/00_setup_env_arm.sh
     94CCACHE_MAXSIZE=500M
     95BASE_OUTDIR=/ci_container_base/ci/scratch/out
     96RUN_UNIT_TESTS=true
     97CI_RETRY_EXE=retry --
     98CI_IMAGE_LABEL=bitcoin-ci-test
     99BINS_SCRATCH_DIR=/ci_container_base/ci/scratch/bins/
    100TEST_RUNNER_TIMEOUT_FACTOR=40
    101PACKAGES=python3-zmq g++-arm-linux-gnueabihf busybox libc6:armhf libstdc++6:armhf libfontconfig1:armhf libxcb1:armhf
    102MAKEJOBS=-j4
    103CONTAINER_NAME=ci_arm_linux
    104PWD=/home/hebasto/git/bitcoin
    105CCACHE_DIR=/ci_container_base/ci/scratch/ccache
    106CI_BASE_PACKAGES=build-essential pkgconf curl ca-certificates ccache python3 rsync git procps bison e2fsprogs cmake
    107BASE_ROOT_DIR=/ci_container_base
    108DEPENDS_DIR=/ci_container_base/depends
    109RUN_FUNCTIONAL_TESTS=false
    110GOAL=install
    111CCACHE_COMPRESS=1
    112DPKG_ADD_ARCH=armhf
    113RUN_TIDY=false
    114HOST=arm-linux-gnueabihf
    115RUN_FUZZ_TESTS=false
    116CI_IMAGE_PLATFORM=linux/arm64
    117USE_BUSY_BOX=true
    118BOOST_TEST_RANDOM=1
    119BITCOIN_CONFIG=-DREDUCE_EXPORTS=ON -DCMAKE_CXX_FLAGS='-Wno-psabi -Wno-error=maybe-uninitialized'
    120SHLVL=2
    121DIR_QA_ASSETS=/ci_container_base/ci/scratch/qa-assets
    122CI_IMAGE_NAME_TAG=docker.io/debian:bookworm
    123BASE_SCRATCH_DIR=/ci_container_base/ci/scratch
    124BASE_READ_ONLY_DIR=/home/hebasto/git/bitcoin
    125LC_ALL=C.UTF-8
    126PREVIOUS_RELEASES_DIR=/ci_container_base/prev_releases
    127DEBIAN_FRONTEND=noninteractive
    128_=/usr/bin/python3
    129+ docker run --platform=linux/arm64 --rm docker.io/debian:bookworm bash -c 'env | grep --extended-regexp '\''^(HOME|PATH|USER)='\'''
    130+ tee --append /tmp/env-hebasto-ci_arm_linux
    131exec /usr/bin/bash: exec format error
    132+ MAYBE_CPUSET=
    133+ '[' '' ']'
    134+ echo 'Creating docker.io/debian:bookworm container to run in'
    135Creating docker.io/debian:bookworm container to run in
    136+ DOCKER_BUILDKIT=1
    137+ docker build --file /home/hebasto/git/bitcoin/ci/test_imagefile --build-arg CI_IMAGE_NAME_TAG=docker.io/debian:bookworm --build-arg FILE_ENV=./ci/test/00_setup_env_arm.sh --platform=linux/arm64 --label=bitcoin-ci-test --tag=ci_arm_linux /home/hebasto/git/bitcoin
    138[+] Building 0.1s (8/8) FINISHED                                                                                                                                                                                     docker:default
    139 => [internal] load build definition from test_imagefile                                                                                                                                                                       0.0s
    140 => => transferring dockerfile: 600B                                                                                                                                                                                           0.0s
    141 => WARN: InvalidDefaultArgInFrom: Default value for ARG ${CI_IMAGE_NAME_TAG} results in empty or invalid base image name (line 8)                                                                                             0.0s
    142 => [internal] load metadata for docker.io/library/debian:bookworm                                                                                                                                                             0.0s
    143 => [internal] load .dockerignore                                                                                                                                                                                              0.0s
    144 => => transferring context: 2B                                                                                                                                                                                                0.0s
    145 => [1/4] FROM docker.io/library/debian:bookworm                                                                                                                                                                               0.0s
    146 => [internal] load build context                                                                                                                                                                                              0.0s
    147 => => transferring context: 249B                                                                                                                                                                                              0.0s
    148 => CACHED [2/4] COPY ./ci/retry/retry /usr/bin/retry                                                                                                                                                                          0.0s
    149 => CACHED [3/4] COPY ./ci/test/00_setup_env.sh ././ci/test/00_setup_env_arm.sh ./ci/test/01_base_install.sh /ci_container_base/ci/test/                                                                                       0.0s
    150 => ERROR [4/4] RUN ["bash", "-c", "cd /ci_container_base/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh"]                                                                             0.1s
    151------                                                                                                                                                                                                                              
    152 > [4/4] RUN ["bash", "-c", "cd /ci_container_base/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh"]:
    1530.099 exec /usr/bin/bash: exec format error
    154------
    155
    156 1 warning found (use docker --debug to expand):
    157 - InvalidDefaultArgInFrom: Default value for ARG ${CI_IMAGE_NAME_TAG} results in empty or invalid base image name (line 8)
    158test_imagefile:16
    159--------------------
    160  14 |     COPY ./ci/test/00_setup_env.sh ./${FILE_ENV} ./ci/test/01_base_install.sh /ci_container_base/ci/test/
    161  15 |     
    162  16 | >>> RUN ["bash", "-c", "cd /ci_container_base/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh"]
    163  17 |     
    164--------------------
    165ERROR: failed to solve: process "bash -c cd /ci_container_base/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh" did not complete successfully: exit code: 1
    
  38. maflcko commented at 9:00 am on January 20, 2025: member

    0.099 exec /usr/bin/bash: exec format error

    This is unrelated to the changes in this pull request, as it happens on master as well.

    You’ll have to set up qemu. Possibly with podman run --rm --privileged docker.io/multiarch/qemu-user-static --reset -p yes

  39. hebasto approved
  40. hebasto commented at 9:09 am on January 20, 2025: member
    ACK 6e29de21010fc5213176a6ba29f754ca72612ea0
  41. fanquake merged this on Jan 20, 2025
  42. fanquake closed this on Jan 20, 2025


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-01-21 03:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me