From 4e80755d76a4dec87125883df7741b8f45466560 Mon Sep 17 00:00:00 2001 From: Peter Lithammer Date: Mon, 8 Nov 2021 17:06:22 +0100 Subject: [PATCH] Add Alpine support to `wheel_linux_before_all.sh` script --- .github/workflows/packages.yml | 3 +- tools/build/wheel_linux_before_all.sh | 48 ++++++++++++++++----------- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 29cd0cbd5..76fd3caa7 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -93,6 +93,7 @@ jobs: matrix: arch: [x86_64, i686, ppc64le, aarch64] pyver: [cp36, cp37, cp38, cp39, cp310] + platform: [manylinux, musllinux] steps: - uses: actions/checkout@v2 @@ -112,7 +113,7 @@ jobs: CIBW_MANYLINUX_I686_IMAGE: manylinux_2_24 CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_24 CIBW_MANYLINUX_PPC64LE_IMAGE: manylinux_2_24 - CIBW_BUILD: ${{matrix.pyver}}-manylinux_${{matrix.arch}} + CIBW_BUILD: ${{matrix.pyver}}-${{matrix.platform}}_${{matrix.arch}} CIBW_ARCHS_LINUX: auto aarch64 ppc64le CIBW_BEFORE_ALL_LINUX: ./tools/build/wheel_linux_before_all.sh CIBW_REPAIR_WHEEL_COMMAND: >- diff --git a/tools/build/wheel_linux_before_all.sh b/tools/build/wheel_linux_before_all.sh index f005bc8de..cd5ee908b 100755 --- a/tools/build/wheel_linux_before_all.sh +++ b/tools/build/wheel_linux_before_all.sh @@ -6,23 +6,33 @@ set -euo pipefail set -x -dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +. /etc/os-release -# Install libpq -# Note that the pgdg doesn't have an aarch64 repository so wheels are build -# with the libpq packaged with Debian 9, which is 9.6. -if [[ ! "$AUDITWHEEL_ARCH" = "aarch64" ]]; then - source /etc/os-release - echo "deb http://apt.postgresql.org/pub/repos/apt ${VERSION_CODENAME}-pgdg main" \ - > /etc/apt/sources.list.d/pgdg.list - # TODO: on 2021-09-30 curl fails with - # curl: (60) SSL certificate problem: certificate has expired - # Test again later if -k can be removed. - curl -sk https://www.postgresql.org/media/keys/ACCC4CF8.asc \ - | apt-key add - -fi - -apt-get update - -# zip is required by strip_wheel.sh -apt-get -y install libpq-dev zip +# Install PostgreSQL development files. +case "$ID" in + alpine) + # zip is required by strip_wheel.sh + # tzdata is required for datetime tests. + apk add --no-cache postgresql-dev tzdata zip + ;; + debian) + # Note that the pgdg doesn't have an aarch64 repository so wheels are + # build with the libpq packaged with Debian 9, which is 9.6. + if [ "$AUDITWHEEL_ARCH" != 'aarch64' ]; then + echo "deb http://apt.postgresql.org/pub/repos/apt $VERSION_CODENAME-pgdg main" \ + > /etc/apt/sources.list.d/pgdg.list + # TODO: On 2021-11-09 curl fails on 'ppc64le' with: + # curl: (60) SSL certificate problem: certificate has expired + # Test again later if -k can be removed. + curl -skf https://www.postgresql.org/media/keys/ACCC4CF8.asc \ + > /etc/apt/trusted.gpg.d/postgresql.asc + fi + apt-get update + # zip is required by strip_wheel.sh + apt-get -y install libpq-dev zip + ;; + *) + echo "Unexpected Linux distribution: '$ID'" >&2 + exit 1 + ;; +esac -- 2.47.2