From e184e460f3cef8ca2eae6e5f29bf6e1905216a0a Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 25 Jun 2023 17:27:11 +0200 Subject: [PATCH 1/2] feature: add musllinux_1_2 --- .github/workflows/build.yml | 2 +- .travis.yml | 8 ++++++++ build.sh | 5 +++++ docker/build_scripts/build-git.sh | 2 +- docker/build_scripts/install-build-packages.sh | 9 +++++++-- docker/build_scripts/install-entrypoint.sh | 2 +- docker/build_scripts/install-runtime-packages.sh | 8 ++++---- docker/build_scripts/update-system-packages.sh | 2 +- tests/run_tests.sh | 2 +- 9 files changed, 29 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 917d9639..320bbe6e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - policy: ["manylinux2014", "musllinux_1_1"] + policy: ["manylinux2014", "musllinux_1_1", "musllinux_1_2"] platform: ["i686", "x86_64"] include: - policy: "manylinux_2_28" diff --git a/.travis.yml b/.travis.yml index cb11b9c9..19dfddfc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,6 +46,14 @@ jobs: env: POLICY="musllinux_1_1" PLATFORM="s390x" - arch: ppc64le env: POLICY="musllinux_1_1" PLATFORM="ppc64le" + - arch: arm64-graviton2 + virt: vm + group: edge + env: POLICY="musllinux_1_2" PLATFORM="aarch64" + - arch: s390x + env: POLICY="musllinux_1_2" PLATFORM="s390x" + - arch: ppc64le + env: POLICY="musllinux_1_2" PLATFORM="ppc64le" before_install: - if [ -d "${HOME}/buildx-cache/.buildx-cache-${POLICY}_${PLATFORM}" ]; then cp -rlf ${HOME}/buildx-cache/.buildx-cache-${POLICY}_${PLATFORM} ./; fi diff --git a/build.sh b/build.sh index 054b5a05..aed53fe5 100755 --- a/build.sh +++ b/build.sh @@ -51,6 +51,11 @@ elif [ "${POLICY}" == "musllinux_1_1" ]; then DEVTOOLSET_ROOTPATH= PREPEND_PATH= LD_LIBRARY_PATH_ARG= +elif [ "${POLICY}" == "musllinux_1_2" ]; then + BASEIMAGE="${MULTIARCH_PREFIX}alpine:3.18" + DEVTOOLSET_ROOTPATH= + PREPEND_PATH= + LD_LIBRARY_PATH_ARG= else echo "Unsupported policy: '${POLICY}'" exit 1 diff --git a/docker/build_scripts/build-git.sh b/docker/build_scripts/build-git.sh index 9c0b02d2..cf0df116 100755 --- a/docker/build_scripts/build-git.sh +++ b/docker/build_scripts/build-git.sh @@ -10,7 +10,7 @@ MY_DIR=$(dirname "${BASH_SOURCE[0]}") # Get build utilities source $MY_DIR/build_utils.sh -if [ "${AUDITWHEEL_POLICY}" == "musllinux_1_1" ]; then +if [ "${BASE_POLICY}" == "musllinux" ]; then export NO_REGEX=NeedsStartEnd fi diff --git a/docker/build_scripts/install-build-packages.sh b/docker/build_scripts/install-build-packages.sh index 408bc332..9bdf6602 100755 --- a/docker/build_scripts/install-build-packages.sh +++ b/docker/build_scripts/install-build-packages.sh @@ -4,11 +4,16 @@ # Stop at any error, show all commands set -exuo pipefail +# Set build environment variables +MY_DIR=$(dirname "${BASH_SOURCE[0]}") + +# Get build utilities +source $MY_DIR/build_utils.sh # if a devel package is added to COMPILE_DEPS, # make sure the corresponding library is added to RUNTIME_DEPS if applicable -if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ] || [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then +if [ "${BASE_POLICY}" == "manylinux" ]; then COMPILE_DEPS="bzip2-devel ncurses-devel readline-devel gdbm-devel libpcap-devel xz-devel openssl openssl-devel keyutils-libs-devel krb5-devel libcom_err-devel libidn-devel curl-devel uuid-devel libffi-devel kernel-headers libdb-devel" if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ]; then PACKAGE_MANAGER=yum @@ -16,7 +21,7 @@ if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ] || [ "${AUDITWHEEL_POLICY}" == PACKAGE_MANAGER=dnf COMPILE_DEPS="${COMPILE_DEPS} tk-devel" fi -elif [ "${AUDITWHEEL_POLICY}" == "musllinux_1_1" ]; then +elif [ "${BASE_POLICY}" == "musllinux" ]; then PACKAGE_MANAGER=apk COMPILE_DEPS="bzip2-dev ncurses-dev readline-dev tk-dev gdbm-dev libpcap-dev xz-dev openssl openssl-dev keyutils-dev krb5-dev libcom_err libidn-dev curl-dev util-linux-dev libffi-dev linux-headers" else diff --git a/docker/build_scripts/install-entrypoint.sh b/docker/build_scripts/install-entrypoint.sh index 9ef1e991..ea32b352 100755 --- a/docker/build_scripts/install-entrypoint.sh +++ b/docker/build_scripts/install-entrypoint.sh @@ -23,6 +23,6 @@ if [ "${AUDITWHEEL_PLAT}" = "manylinux2014_i686" ]; then LC_ALL=C "${MY_DIR}/update-system-packages.sh" fi -if [ "${AUDITWHEEL_POLICY}" = "musllinux_1_1" ]; then +if [ "${AUDITWHEEL_POLICY}" = "musllinux_1_1" ] || [ "${AUDITWHEEL_POLICY}" = "musllinux_1_2" ]; then apk add --no-cache bash fi diff --git a/docker/build_scripts/install-runtime-packages.sh b/docker/build_scripts/install-runtime-packages.sh index 137d2e2d..310d6a7e 100755 --- a/docker/build_scripts/install-runtime-packages.sh +++ b/docker/build_scripts/install-runtime-packages.sh @@ -34,7 +34,7 @@ source $MY_DIR/build_utils.sh # MANYLINUX_DEPS: Install development packages (except for libgcc which is provided by gcc install) if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ] || [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then MANYLINUX_DEPS="glibc-devel libstdc++-devel glib2-devel libX11-devel libXext-devel libXrender-devel mesa-libGL-devel libICE-devel libSM-devel zlib-devel expat-devel" -elif [ "${AUDITWHEEL_POLICY}" == "musllinux_1_1" ]; then +elif [ "${BASE_POLICY}" == "musllinux" ]; then MANYLINUX_DEPS="musl-dev libstdc++ glib-dev libx11-dev libxext-dev libxrender-dev mesa-dev libice-dev libsm-dev zlib-dev expat-dev" else echo "Unsupported policy: '${AUDITWHEEL_POLICY}'" @@ -47,8 +47,8 @@ if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ] || [ "${AUDITWHEEL_POLICY}" == if [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then RUNTIME_DEPS="${RUNTIME_DEPS} tk" fi -elif [ "${AUDITWHEEL_POLICY}" == "musllinux_1_1" ]; then - RUNTIME_DEPS="zlib bzip2 expat ncurses5-libs readline tk gdbm db xz openssl keyutils-libs krb5-libs libcom_err libidn2 libcurl libuuid libffi" +elif [ "${BASE_POLICY}" == "musllinux" ]; then + RUNTIME_DEPS="zlib bzip2 expat ncurses-libs readline tk gdbm db xz openssl keyutils-libs krb5-libs libcom_err libidn2 libcurl libuuid libffi" else echo "Unsupported policy: '${AUDITWHEEL_POLICY}'" exit 1 @@ -100,7 +100,7 @@ elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then if [ "${AUDITWHEEL_ARCH}" == "x86_64" ]; then TOOLCHAIN_DEPS="${TOOLCHAIN_DEPS} yasm" fi -elif [ "${AUDITWHEEL_POLICY}" == "musllinux_1_1" ]; then +elif [ "${BASE_POLICY}" == "musllinux" ]; then TOOLCHAIN_DEPS="binutils gcc g++ gfortran" BASETOOLS="${BASETOOLS} curl util-linux tar" PACKAGE_MANAGER=apk diff --git a/docker/build_scripts/update-system-packages.sh b/docker/build_scripts/update-system-packages.sh index c56c0b01..bec18170 100755 --- a/docker/build_scripts/update-system-packages.sh +++ b/docker/build_scripts/update-system-packages.sh @@ -24,7 +24,7 @@ elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then dnf -y upgrade dnf clean all rm -rf /var/cache/yum -elif [ "${AUDITWHEEL_POLICY}" == "musllinux_1_1" ]; then +elif [ "${BASE_POLICY}" == "musllinux" ]; then apk upgrade --no-cache else echo "Unsupported policy: '${AUDITWHEEL_POLICY}'" diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 3cbaf62b..095157cc 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -8,7 +8,7 @@ MY_DIR=$(dirname "${BASH_SOURCE[0]}") if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ]; then PACKAGE_MANAGER=yum -elif [ "${AUDITWHEEL_POLICY}" == "musllinux_1_1" ]; then +elif [ "${AUDITWHEEL_POLICY:0:10}" == "musllinux_" ]; then PACKAGE_MANAGER=apk elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then PACKAGE_MANAGER=dnf From 8a7d37914d6c60e1d8f35d04114aa1c4b30709a3 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 23 Jul 2023 20:03:19 +0200 Subject: [PATCH 2/2] chore: always update docker --- travisci-install-buildx.sh | 39 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/travisci-install-buildx.sh b/travisci-install-buildx.sh index c195b9ca..77b9c6aa 100755 --- a/travisci-install-buildx.sh +++ b/travisci-install-buildx.sh @@ -47,26 +47,25 @@ EOF fi # default to docker-buildx frontend -if [ ${BUILDX_MACHINE} == "ppc64le" ]; then - # We need to update docker to get buildx support, c.f. https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository - sudo systemctl stop docker - sudo apt-get update - sudo apt-get purge -y docker docker.io containerd runc - sudo apt-get install -y --no-install-recommends ca-certificates curl gnupg lsb-release - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - sudo apt-get update - # prevent the docker service to start upon installation - echo -e '#!/bin/sh\nexit 101' | sudo tee /usr/sbin/policy-rc.d - sudo chmod +x /usr/sbin/policy-rc.d - # install docker - sudo apt-get install docker-ce docker-ce-cli docker-ce-rootless-extras - # "restore" policy-rc.d - sudo rm -f /usr/sbin/policy-rc.d - sudo sed -i 's;fd://;unix://;g' /lib/systemd/system/docker.service - sudo systemctl daemon-reload - sudo systemctl start docker -fi +# We need to update docker to get buildx support, c.f. https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository +sudo systemctl stop docker +sudo apt-get update +sudo apt-get purge -y docker docker.io containerd runc +sudo apt-get install -y --no-install-recommends ca-certificates curl gnupg lsb-release +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +sudo apt-get update +# prevent the docker service to start upon installation +echo -e '#!/bin/sh\nexit 101' | sudo tee /usr/sbin/policy-rc.d +sudo chmod +x /usr/sbin/policy-rc.d +# install docker +sudo apt-get install docker-ce docker-ce-cli docker-ce-rootless-extras +# "restore" policy-rc.d +sudo rm -f /usr/sbin/policy-rc.d +sudo sed -i 's;fd://;unix://;g' /lib/systemd/system/docker.service +sudo systemctl daemon-reload +sudo systemctl start docker + if [ "${MANYLINUX_BUILD_FRONTEND:-}" == "docker" ]; then exit 0 fi