Skip to content

Commit

Permalink
CI: Update cibuildwheel usage (#1759)
Browse files Browse the repository at this point in the history
We are running a fairly old version of cibuildwheel (`1.8.0`, newest is `2.2.0`),
so let's try to benefit from all the good features in the new one (like `musllinux`
wheel support).

Currently it is not possible to run sourmash (easily) in distros using musl as
the C standard library. `manylinux` wheels are intended for GLIBC, and trying
to `pip install sourmash` in Alpine (which uses `musl`) will trigger compilation
from source. `musllinux` is a new wheel format that accounts for musl systems,
and so now users in Alpine can run the same as users in Ubuntu or Fedora.

It doesn't change anything for any non-musl dev environments, but it does
increase the build time because there are two extra wheels being compiled,
for `x86_64` and `aarch64`. The latter takes a LONG time, but it is not a
required check for merging PRs (only `x86_64` wheels are required, in
either Linux or MacOS).
  • Loading branch information
luizirber authored Oct 25, 2021
1 parent d91911b commit 5accf22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static"]

[target.aarch64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static"]
12 changes: 3 additions & 9 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,27 @@ jobs:
with:
python-version: '3.9'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.8.0
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "cp39-*"
CIBW_SKIP: "*-win32 *-manylinux_i686"
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_ppc64le *-musllinux_s390x"
CIBW_BEFORE_BUILD: 'source .ci/install_cargo.sh'
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH"'
CIBW_ENVIRONMENT_MACOS: ${{ matrix.macos_target }}
CIBW_BUILD_VERBOSITY: 3
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
run: |
python -m cibuildwheel --output-dir dist
ls -lR ./dist

- uses: actions/upload-artifact@v2
with:
path: './dist/sourmash*.whl'
path: './wheelhouse/sourmash*.whl'

release:
name: Publish wheels
Expand Down

0 comments on commit 5accf22

Please sign in to comment.