diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 391bb61..cec31c8 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -60,8 +60,7 @@ jobs: # Non-Python packages to install as spkgs TARGETS_PRE: gmp mpfr normaliz # Disable building PyPy wheels on all platforms - # Disable musllinux until #33083 provides alpine package information - CIBW_SKIP: "pp* *-musllinux*" + CIBW_SKIP: "pp*" # CIBW_ARCHS: ${{ matrix.arch }} # https://cibuildwheel.readthedocs.io/en/stable/options/#requires-python @@ -89,6 +88,39 @@ jobs: python-version: "3.8 - 3.12" update-environment: false + - name: Retrieve configure tarball cache + id: cache-configure + uses: actions/cache/restore@v4 + with: + path: | + build/pkgs/configure + upstream/configure* + key: >- + configure-build=${{ + hashFiles('build', + 'configure.ac', + 'm4') + }} + + - name: Bootstrap + if: steps.cache-configure.outputs.cache-hit != 'true' + # Patch python3 spkg-configure to allow Python 3.8.0 during the CIBW_BEFORE_ALL phase + run: | + export PATH=$(pwd)/build/bin:$PATH + eval $(sage-print-system-package-command auto --sudo --yes update) + eval $(sage-print-system-package-command auto --sudo --yes --no-install-recommends --spkg install _bootstrap bzip2 xz liblzma) + sed -i.bak '/m4_pushdef.*MIN_VERSION/s/3[0-9.]*/3.8.0/' build/pkgs/python3/spkg-configure.m4 + ./bootstrap -s + + - name: Save configure tarball cache + if: steps.cache-configure.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: | + build/pkgs/configure + upstream/configure* + key: ${{ steps.cache-configure.outputs.cache-primary-key }} + - name: Build platform wheels # We build the wheel from the sdist. # But we must run cibuildwheel with the unpacked source directory, not a tarball, @@ -98,12 +130,14 @@ jobs: # https://cibuildwheel.readthedocs.io/en/stable/options/#before-all run: | "${{ steps.python.outputs.python-path }}" -m pip install pipx + if [ ! -x ./configure ]; then ./bootstrap -D; fi + touch configure export PATH=build/bin:$PATH - export CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || $(sage-print-system-package-command alpine --yes --no-install-recommends install $(sage-get-system-packages alpine $SPKGS)) || echo error ignored) ) && ./bootstrap && ./configure --enable-build-as-root --enable-fat-binary && MAKE=\"make -j6\" make V=0 $TARGETS_PRE" + export CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || $(sage-print-system-package-command alpine --yes --no-install-recommends install $(sage-get-system-packages alpine $SPKGS)) || echo error ignored) ) && ./configure --enable-build-as-root --enable-fat-binary --disable-python-distutils-check && MAKE=\"make -j6\" make V=0 $TARGETS_PRE" mkdir -p unpacked for pkg in pynormaliz; do (cd unpacked && tar xfz - ) < dist/$pkg*.tar.gz - "${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.18.0 unpacked/$pkg* + "${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.21.3 unpacked/$pkg* done - uses: actions/upload-artifact@v4