From 42dd07cfd33f40fd6bf204c86c9f38a555f236cb Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sun, 9 Feb 2025 12:25:34 -0500 Subject: [PATCH 1/7] build armv7l images (#669) * build armv7l images * Update build-docker-images.yml * Don't use `enable-ec_nistp_64_gcc_128` on armv7l * hack? * We are an armv4 build (cherry picked from commit 519b16bd0803ea22dbd0a4525c641060581c0215) --- build-scripts/manylinux-container-image/install_openssl.sh | 5 +++++ build-scripts/manylinux-container-image/openssl-version.sh | 1 + 2 files changed, 6 insertions(+) diff --git a/build-scripts/manylinux-container-image/install_openssl.sh b/build-scripts/manylinux-container-image/install_openssl.sh index 4db36ef0e..577f2e838 100755 --- a/build-scripts/manylinux-container-image/install_openssl.sh +++ b/build-scripts/manylinux-container-image/install_openssl.sh @@ -21,6 +21,11 @@ BUILD_FLAGS="$OPENSSL_BUILD_FLAGS" if [[ "$1" =~ '^manylinux1_.*$' ]]; then PATH=/opt/perl/bin:$PATH fi +# Can't use `$(uname -m) = "armv7l"` because that returns what kernel we're +# using, and we build for armv7l with an ARM64 host. +if [ "$(readelf -h /proc/self/exe | grep -o 'Machine:.* ARM')" ]; then + BUILD_FLAGS="$OPENSSL_BUILD_FLAGS_ARMV7L" +fi if [ "$(readelf -h /proc/self/exe | grep -o 'Machine:.* S/390')" ]; then BUILD_FLAGS="$OPENSSL_BUILD_FLAGS_S390X" export CFLAGS="$CFLAGS -march=z10" diff --git a/build-scripts/manylinux-container-image/openssl-version.sh b/build-scripts/manylinux-container-image/openssl-version.sh index e9d5e95f1..df84da34c 100644 --- a/build-scripts/manylinux-container-image/openssl-version.sh +++ b/build-scripts/manylinux-container-image/openssl-version.sh @@ -3,5 +3,6 @@ export OPENSSL_SHA256="344d0a79f1a9b08029b0744e2cc401a43f9c90acd1044d09a530b4885 # We need a base set of flags because on Windows using MSVC # enable-ec_nistp_64_gcc_128 doesn't work since there's no 128-bit type export OPENSSL_BUILD_FLAGS_WINDOWS="no-ssl3 no-ssl3-method no-zlib no-shared no-module no-comp no-dynamic-engine no-apps no-docs no-sm2-precomp no-atexit" +export OPENSSL_BUILD_FLAGS_ARMV7L="linux-armv4 ${OPENSSL_BUILD_FLAGS_WINDOWS}" export OPENSSL_BUILD_FLAGS_S390X="${OPENSSL_BUILD_FLAGS_WINDOWS}" export OPENSSL_BUILD_FLAGS="${OPENSSL_BUILD_FLAGS_WINDOWS} enable-ec_nistp_64_gcc_128" From b5f0964a9618521ddfdb4830d7ee1372717dcf89 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 9 May 2025 16:32:40 +0200 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=A7=AA=20Pre-build=20armv7l=20images?= =?UTF-8?q?=20for=20building=20wheels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are relatively recent upstream and only exist for glibc 2.31. --- .../workflows/build-manylinux-container-images.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-manylinux-container-images.yml b/.github/workflows/build-manylinux-container-images.yml index 8c67d4f45..fb5292797 100644 --- a/.github/workflows/build-manylinux-container-images.yml +++ b/.github/workflows/build-manylinux-container-images.yml @@ -38,17 +38,15 @@ jobs: - ARCH: ppc64le # Build containers for s390x - ARCH: s390x - # There are no base containers for these archs - # at https://quay.io/organization/pypa. - # Build containers for armv7l (ARM v7) - # - ARCH: armv7l - # QEMU_ARCH: arm/v7 - # Build containers for ppc64 - # - ARCH: ppc64 YEAR: - _2_24 - _2_28 - _2_34 + include: + - IMAGE: + ARCH: armv7l + HOST_OS: ubuntu-24.04-arm + YEAR: _2_31 # There are no base images prior to 2.31 for this arch env: LIBSSH_VERSION: 0.11.1 @@ -78,7 +76,7 @@ jobs: Set up QEMU ${{ env.QEMU_ARCH }} arch emulation with Podman if: >- - !contains(fromJSON('["aarch64", "amd64"]'), env.QEMU_ARCH) + !contains(fromJSON('["aarch64", "amd64", "armv7l"]'), env.QEMU_ARCH) run: > sudo podman run --rm --privileged From 4a6715be6d33b33f1dfdf95cdee5a80f2a633a2c Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 9 May 2025 19:29:48 +0200 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=93=A6=20Unprefix=20openssl=20archive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-scripts/manylinux-container-image/install_openssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-scripts/manylinux-container-image/install_openssl.sh b/build-scripts/manylinux-container-image/install_openssl.sh index 577f2e838..22c6e9f0d 100755 --- a/build-scripts/manylinux-container-image/install_openssl.sh +++ b/build-scripts/manylinux-container-image/install_openssl.sh @@ -37,4 +37,4 @@ make -j4 # https://github.com/openssl/openssl/issues/6685#issuecomment-403838728 make install_sw install_ssldirs popd -rm -rf openssl* +rm -rf ${OPENSSL_VERSION} From 35c0a7f5f13c5265991ae849869db7675629bb9e Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 9 May 2025 19:42:36 +0200 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=93=A6=20Pre-install=20system=20deps?= =?UTF-8?q?=20@=20container=20image=20bld?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manylinux-container-image/Dockerfile | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build-scripts/manylinux-container-image/Dockerfile b/build-scripts/manylinux-container-image/Dockerfile index 37a78edf0..4f0b7f7c6 100644 --- a/build-scripts/manylinux-container-image/Dockerfile +++ b/build-scripts/manylinux-container-image/Dockerfile @@ -26,6 +26,28 @@ RUN \ fi; \ fi +RUN \ + if [ $(uname -m) = "x86_64" ]; \ + then \ + if stat /etc/redhat-release 1>&2 2>/dev/null; then \ + yum -y install binutils perl perl-IPC-Cmd && \ + yum -y clean all && \ + rm -rf /var/cache/yum; \ + fi; \ + fi + +# This is done as two separate steps because readelf (binutils) is not available on +# aarch64. +RUN \ + if [ $(uname -m) = "aarch64" ]; \ + then \ + if stat /etc/redhat-release 1>&2 2>/dev/null; then \ + yum -y install perl perl-IPC-Cmd && \ + yum -y clean all && \ + rm -rf /var/cache/yum; \ + fi; \ + fi + ADD build_utils.sh /root/build_utils.sh ADD install_perl.sh /root/install_perl.sh RUN ./install_perl.sh "${RELEASE}" From 41f16faf35d7d84cdcdf142d78a4958a1f4e1e2d Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 10 Jun 2025 22:15:27 +0200 Subject: [PATCH 5/7] =?UTF-8?q?Revert=20"=F0=9F=93=A6=20Pre-install=20syst?= =?UTF-8?q?em=20deps=20@=20container=20image=20bld"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 582ad3477613887becc5b554040e4882f5c3d68d. --- .../manylinux-container-image/Dockerfile | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/build-scripts/manylinux-container-image/Dockerfile b/build-scripts/manylinux-container-image/Dockerfile index 4f0b7f7c6..37a78edf0 100644 --- a/build-scripts/manylinux-container-image/Dockerfile +++ b/build-scripts/manylinux-container-image/Dockerfile @@ -26,28 +26,6 @@ RUN \ fi; \ fi -RUN \ - if [ $(uname -m) = "x86_64" ]; \ - then \ - if stat /etc/redhat-release 1>&2 2>/dev/null; then \ - yum -y install binutils perl perl-IPC-Cmd && \ - yum -y clean all && \ - rm -rf /var/cache/yum; \ - fi; \ - fi - -# This is done as two separate steps because readelf (binutils) is not available on -# aarch64. -RUN \ - if [ $(uname -m) = "aarch64" ]; \ - then \ - if stat /etc/redhat-release 1>&2 2>/dev/null; then \ - yum -y install perl perl-IPC-Cmd && \ - yum -y clean all && \ - rm -rf /var/cache/yum; \ - fi; \ - fi - ADD build_utils.sh /root/build_utils.sh ADD install_perl.sh /root/install_perl.sh RUN ./install_perl.sh "${RELEASE}" From d5bbe20bb59e871c732657a5de5c519f97dce782 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 9 May 2025 19:44:54 +0200 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=93=A6=20Stop=20compiling=20Perl=20in?= =?UTF-8?q?=20image=20builds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manylinux-container-image/Dockerfile | 2 -- .../manylinux-container-image/install_perl.sh | 23 ------------------- 2 files changed, 25 deletions(-) delete mode 100755 build-scripts/manylinux-container-image/install_perl.sh diff --git a/build-scripts/manylinux-container-image/Dockerfile b/build-scripts/manylinux-container-image/Dockerfile index 37a78edf0..dfe9d2b7e 100644 --- a/build-scripts/manylinux-container-image/Dockerfile +++ b/build-scripts/manylinux-container-image/Dockerfile @@ -27,8 +27,6 @@ RUN \ fi ADD build_utils.sh /root/build_utils.sh -ADD install_perl.sh /root/install_perl.sh -RUN ./install_perl.sh "${RELEASE}" ADD install_libffi.sh /root/install_libffi.sh RUN ./install_libffi.sh "${RELEASE}" ADD install_openssl.sh /root/install_openssl.sh diff --git a/build-scripts/manylinux-container-image/install_perl.sh b/build-scripts/manylinux-container-image/install_perl.sh deleted file mode 100755 index 27e70a9f6..000000000 --- a/build-scripts/manylinux-container-image/install_perl.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -set -xe - -unset RELEASE - -# Get script directory -MY_DIR=$(dirname "${BASH_SOURCE[0]}") - -# Get build utilities -source $MY_DIR/build_utils.sh - -PERL_SHA256="e6c185c9b09bdb3f1b13f678999050c639859a7ef39c8cad418448075f5918af" -PERL_VERSION="5.24.1" - -if [[ "$1" =~ "^manylinux1_*" ]]; then - fetch_source "perl-${PERL_VERSION}.tar.gz" "https://www.cpan.org/src/5.0" - check_sha256sum "perl-${PERL_VERSION}.tar.gz" ${PERL_SHA256} - - tar zxf perl-$PERL_VERSION.tar.gz && \ - cd perl-$PERL_VERSION && \ - ./Configure -des -Dprefix=/opt/perl && \ - make -j && make install -fi From 1585685906cb6c36e232c29b15060e2fcdf5b1e5 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sat, 10 May 2025 11:14:24 +0200 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=93=A6=20Stop=20linking=20against=20l?= =?UTF-8?q?ibdl=20in=20manylinux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-scripts/manylinux-container-image/install_libssh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-scripts/manylinux-container-image/install_libssh.sh b/build-scripts/manylinux-container-image/install_libssh.sh index 5fa161dbd..518c5454f 100755 --- a/build-scripts/manylinux-container-image/install_libssh.sh +++ b/build-scripts/manylinux-container-image/install_libssh.sh @@ -39,7 +39,7 @@ fi # make[2]: *** [examples/libssh_scp] Error 1 # make[1]: *** [examples/CMakeFiles/libssh_scp.dir/all] Error 2 # make: *** [all] Error 2 -export LDFLAGS="-pthread -ldl" +export LDFLAGS="-pthread" # NOTE: `PKG_CONFIG_PATH` is necessary for `cmake` to be able to locate # NOTE: C-headers files `*.h`. Otherwise, the error is: