Skip to content

Commit c62d189

Browse files
authored
Merge pull request #121 from passagemath/musllinux-wheels
.github/workflows/dist.yml: Build musllinux wheels
2 parents f5dc544 + c76ec00 commit c62d189

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

.github/workflows/dist.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ jobs:
6060
# Non-Python packages to install as spkgs
6161
TARGETS_PRE: gmp mpfr normaliz
6262
# Disable building PyPy wheels on all platforms
63-
# Disable musllinux until #33083 provides alpine package information
64-
CIBW_SKIP: "pp* *-musllinux*"
63+
CIBW_SKIP: "pp*"
6564
#
6665
CIBW_ARCHS: ${{ matrix.arch }}
6766
# https://cibuildwheel.readthedocs.io/en/stable/options/#requires-python
@@ -89,6 +88,39 @@ jobs:
8988
python-version: "3.8 - 3.12"
9089
update-environment: false
9190

91+
- name: Retrieve configure tarball cache
92+
id: cache-configure
93+
uses: actions/cache/restore@v4
94+
with:
95+
path: |
96+
build/pkgs/configure
97+
upstream/configure*
98+
key: >-
99+
configure-build=${{
100+
hashFiles('build',
101+
'configure.ac',
102+
'm4')
103+
}}
104+
105+
- name: Bootstrap
106+
if: steps.cache-configure.outputs.cache-hit != 'true'
107+
# Patch python3 spkg-configure to allow Python 3.8.0 during the CIBW_BEFORE_ALL phase
108+
run: |
109+
export PATH=$(pwd)/build/bin:$PATH
110+
eval $(sage-print-system-package-command auto --sudo --yes update)
111+
eval $(sage-print-system-package-command auto --sudo --yes --no-install-recommends --spkg install _bootstrap bzip2 xz liblzma)
112+
sed -i.bak '/m4_pushdef.*MIN_VERSION/s/3[0-9.]*/3.8.0/' build/pkgs/python3/spkg-configure.m4
113+
./bootstrap -s
114+
115+
- name: Save configure tarball cache
116+
if: steps.cache-configure.outputs.cache-hit != 'true'
117+
uses: actions/cache/save@v4
118+
with:
119+
path: |
120+
build/pkgs/configure
121+
upstream/configure*
122+
key: ${{ steps.cache-configure.outputs.cache-primary-key }}
123+
92124
- name: Build platform wheels
93125
# We build the wheel from the sdist.
94126
# But we must run cibuildwheel with the unpacked source directory, not a tarball,
@@ -98,12 +130,14 @@ jobs:
98130
# https://cibuildwheel.readthedocs.io/en/stable/options/#before-all
99131
run: |
100132
"${{ steps.python.outputs.python-path }}" -m pip install pipx
133+
if [ ! -x ./configure ]; then ./bootstrap -D; fi
134+
touch configure
101135
export PATH=build/bin:$PATH
102-
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"
136+
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"
103137
mkdir -p unpacked
104138
for pkg in pynormaliz; do
105139
(cd unpacked && tar xfz - ) < dist/$pkg*.tar.gz
106-
"${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.18.0 unpacked/$pkg*
140+
"${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.21.3 unpacked/$pkg*
107141
done
108142
109143
- uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)