ci/cirrus: Add native ARM64 jobs #1426

pull maflcko wants to merge 2 commits into bitcoin-core:master from maflcko:2309-ci-arm- changing 2 files +102 −3
  1. maflcko commented at 12:26 PM on September 20, 2023: contributor

    No description provided.

  2. ci/cirrus: Bring back skeleton .cirrus.yml without jobs 2262d0eaab
  3. maflcko marked this as a draft on Sep 20, 2023
  4. maflcko renamed this:
    2309 ci arm
    ci/cirrus: Add native ARM64 jobs
    on Sep 20, 2023
  5. maflcko commented at 2:35 PM on September 20, 2023: contributor

    cc @real-or-random Any thoughts on this or bike-shed ideas?

  6. maflcko marked this as ready for review on Sep 20, 2023
  7. in ci/linux-debian.Dockerfile:39 in 2f31c66cfb outdated
      36 | -        python3
      37 | +        python3 && \
      38 | +        if ! ( dpkg --print-architecture | grep --quiet "arm64" ) ; then \
      39 | +         apt-get install --no-install-recommends -y \
      40 | +         gcc-aarch64-linux-gnu libc6-dev-arm64-cross libc6-dbg:arm64 ;\
      41 | +        fi
    


    real-or-random commented at 4:03 PM on September 20, 2023:

    Strictly speaking, this is unrelated to this PR, but I think it's good practice/idiom to clean the cache after every apt-get to make the cached layer smaller, so we should add it here

            fi && \
            apt-get clean && rm -rf /var/lib/apt/lists/*
    
  8. real-or-random commented at 4:05 PM on September 20, 2023: contributor

    Concept ACK

    There are a few lines added in the second commit and removed again in the third commit. I suggest just squashing the two commits.

    This solves one item in #1392, cc @hebasto.

  9. real-or-random added the label ci on Sep 20, 2023
  10. real-or-random added the label assurance on Sep 20, 2023
  11. hebasto commented at 4:30 PM on September 20, 2023: member

    Where is the docker image cache located?

    Is it possible to demonstrate the build_script with unpopulated cache?

  12. maflcko commented at 4:47 PM on September 20, 2023: contributor

    Where is the docker image cache located?

    It is using the Bitcoin Core persistent workers.

  13. maflcko commented at 4:47 PM on September 20, 2023: contributor

    Is it possible to demonstrate the build_script with unpopulated cache?

    Yes, you can just pick the task with the longest runtime: https://cirrus-ci.com/task/4555435512954880

  14. in ci/linux-debian.Dockerfile:38 in 2f31c66cfb outdated
      35 |          gcc-mingw-w64-i686-win32 wine32 \
      36 | -        python3
      37 | +        python3 && \
      38 | +        if ! ( dpkg --print-architecture | grep --quiet "arm64" ) ; then \
      39 | +         apt-get install --no-install-recommends -y \
      40 | +         gcc-aarch64-linux-gnu libc6-dev-arm64-cross libc6-dbg:arm64 ;\
    


    hebasto commented at 4:55 PM on September 20, 2023:

    On an arm64 worker, other cross-toolchains are also not used. Maybe move them into this if block?


    real-or-random commented at 5:03 PM on September 20, 2023:

    The reason to keep these packages is that the Docker image can then be used by developers locally and has all the tools available for testing (if they have ARM machines, but this is not unlikely with recent Mac hardware). And okay, yeah, it costs a bit of time on CI, but I assume it's in the range of seconds?!


    maflcko commented at 5:04 PM on September 20, 2023:

    It is actually a presumed upstream bug that this list of install needs to be touched. It should not result in a bug to install a package.

  15. hebasto approved
  16. hebasto commented at 4:55 PM on September 20, 2023: member

    ACK 2f31c66cfb1faf34397ddb3850adbfdb6836586c.

  17. maflcko commented at 5:00 PM on September 20, 2023: contributor

    There are a few lines added in the second commit and removed again in the third commit. I suggest just squashing the two commits.

    Who should be the author of the commit then?

  18. real-or-random commented at 5:04 PM on September 20, 2023: contributor

    Who should be the author of the commit then?

    You and add me in Co-authored-by:? Or the other way around, I don't care. Happy to flip a coin for you if you can't decide. :)

  19. maflcko commented at 5:07 PM on September 20, 2023: contributor

    You and add me in Co-authored-by:?

    Thx, done

  20. ci/cirrus: Add native ARM64 persistent workers
    Co-authored-by: Tim Ruffing <crypto@timruffing.de>
    fa4d6c76b6
  21. real-or-random commented at 5:14 PM on September 20, 2023: contributor

    You and add me in Co-authored-by:?

    Thx, done

    Now it's authored and co-authored by me. :D

    edit: Nevermind, I'm wrong. For some reason, github doesn't show your picture here, so I assumed it's just me.

  22. real-or-random approved
  23. real-or-random commented at 5:22 PM on September 20, 2023: contributor

    ACK fa4d6c76b6dc249d02c926ad75725556614fdddd

  24. hebasto approved
  25. hebasto commented at 5:25 PM on September 20, 2023: member

    re-ACK fa4d6c76b6dc249d02c926ad75725556614fdddd, only last two commits have been squashed since my recent review.

  26. real-or-random merged this on Sep 20, 2023
  27. real-or-random closed this on Sep 20, 2023

  28. real-or-random commented at 11:16 PM on September 20, 2023: contributor

    @MarcoFalke Follow-up question: Can the persistent runner run ARM32 binaries natively? From what I remember, most ARM64 machines can do this, but it depends on the CPU. If yes, we could add jobs tests for this, too.

  29. maflcko commented at 9:08 AM on September 21, 2023: contributor

    Yes:

    lscpu | grep op-mode
    CPU op-mode(s):                     32-bit, 64-bit
    
  30. maflcko deleted the branch on Sep 21, 2023
  31. in .cirrus.yml:59 in fa4d6c76b6
      54 | +    - env | tee /tmp/env
      55 | +  build_script:
      56 | +    - DOCKER_BUILDKIT=1 docker build --file "ci/linux-debian.Dockerfile" --tag="ci_secp256k1_arm"
      57 | +    - docker image prune --force  # Cleanup stale layers
      58 | +  test_script:
      59 | +    - docker run --rm --mount "type=bind,src=./,dst=/ci_secp256k1" --env-file /tmp/env --replace --name "ci_secp256k1_arm" "ci_secp256k1_arm" bash -c "cd /ci_secp256k1/ && ./ci/ci.sh"
    


    real-or-random commented at 9:23 AM on October 26, 2023:

    @maflcko
    I think --replace is a podman-only argument. docker run doesn't seem to have it. Should we just rewrite the command to use the "native" podman syntax? I guess there's no point in having an invalid docker command here.


    maflcko commented at 10:54 AM on October 26, 2023:

    Yes, if you prefer to call podman here, you can do that.

    Both commands will redirect to podman, currently.


    real-or-random commented at 5:43 PM on October 26, 2023:

    On a second thought, we could also prepend docker rm --force ci_secp256k1_arm, which has the same effect as --replace.


    maflcko commented at 8:33 AM on October 27, 2023:

    Yes, this should also work. But I haven't fully figured out whether it may be racy if there is a zombie process running in the container.

  32. in .cirrus.yml:57 in fa4d6c76b6
      52 | +linux_arm64_container_snippet: &LINUX_ARM64_CONTAINER
      53 | +  env_script:
      54 | +    - env | tee /tmp/env
      55 | +  build_script:
      56 | +    - DOCKER_BUILDKIT=1 docker build --file "ci/linux-debian.Dockerfile" --tag="ci_secp256k1_arm"
      57 | +    - docker image prune --force  # Cleanup stale layers
    


    maflcko commented at 8:35 AM on October 27, 2023:

    On a second thought, when using podman, this should probably specify --external, because build images will be considered external.

    (No rush to change anything here, though. The hosts will occasionally clean up external images already)

  33. fanquake referenced this in commit 41e1b677ca on Jan 3, 2024
  34. fanquake referenced this in commit 29fde0223a on Jan 4, 2024
  35. janus referenced this in commit 5fe435c9b2 on Apr 6, 2024
  36. hebasto referenced this in commit b6de625950 on May 11, 2024
  37. delta1 referenced this in commit 6089844b3c on Apr 2, 2025
  38. div72 referenced this in commit af627d47c3 on Apr 12, 2025
  39. str4d referenced this in commit 136aa9fe62 on Jun 4, 2025
  40. oskarszoon referenced this in commit 0d5c9260f4 on Jul 1, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:52 UTC