Fix missing Linux wheels: switch CI to cibuildwheel - #1
Merged
Conversation
The v2.3.0 release shipped macOS and Windows wheels but no Linux wheel — only the sdist — so every Linux/HPC `pip install hapc` fell back to compiling from source (GLIBC / timespec_get / sysroot pain). Root cause: the hand-rolled manylinux job ran a `docker://manylinux2014` container and looped over `/opt/python/*/bin`, but the `[[ $PYBIN == *cp38* || ... ]]` match never fired, so `pip wheel` never ran and dist/ stayed empty. upload-artifact only *warned* on the empty dir, the job went green, and publish shipped only the mac/win artifacts. Changes: - Replace the redundant matrix + docker loop with pypa/cibuildwheel; one job per OS builds + repairs all CPython ABIs (cp38-cp312). - manylinux2014 baseline (glibc 2.17 + bundled libstdc++) so wheels run unmodified on HPC clusters with no toolchain. - Split macOS into Intel (macos-13) + Apple Silicon (macos-14) native builds; smoke-test every wheel with `import hapc` before publish. - Guardrails so this can't silently recur: if-no-files-found: error on upload, and a publish-time check that aborts unless a manylinux wheel is present. - Move build config into [tool.cibuildwheel] in pyproject.toml so it's reproducible locally via `pipx run cibuildwheel`. - README: add Linux/HPC install notes; fix yourusername placeholder URLs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The first dry run surfaced two latent bugs that the old workflow never hit because it never actually compiled on Linux: 1. Linux: CMakeLists required the full Python3 `Development` component, which pulls in `Development.Embed` -> libpython. manylinux images deliberately ship no libpython, so configure failed with "Could NOT find Python3 (missing: Python3_LIBRARIES Development.Embed)". Use `Development.Module` (headers only) — the correct component for building an extension module. Requires CMake >= 3.18 (bumped minimum + build dep). 2. macOS: cibuildwheel's cp38 interpreter on the arm64 runner is x86_64-only, so CMake emitted an x86_64 .so while the wheel was tagged arm64, and delocate rejected the arch mismatch. Build proper fat universal2 wheels from one runner by forcing CMAKE_OSX_ARCHITECTURES. setup.py now appends the conventional $CMAKE_ARGS env var to the cmake invocation; pyproject sets it for macOS. (This also catches the old single-arch-but-universal2-tagged wheels — delocate now verifies both slices are present.) Drop the redundant macos-13 runner: universal2 is built fat from macos-14. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The cibuildwheel dry run built and auditwheel-repaired all Linux wheels (cp38-cp312) successfully, but the per-wheel `import hapc` smoke test failed: installing the wheel pulls scikit-learn -> scipy, and the latest scipy no longer ships a manylinux2014 wheel, so pip tried to build it from source inside the glibc-2.17 test container and failed with "OpenBLAS not found". Pre-install `scipy<1.14` via test-requires so the resolver stays on a scipy version that has a 2014 wheel. The wheel under test is fine on real systems (modern pip installs scipy's manylinux_2_28 wheel); this only fixes the in-container smoke test. (test-environment / PIP_ONLY_BINARY was tried first but that option only exists in cibuildwheel 3.x; we pin 2.23.3 for cp38 support.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The previous attempt used test-requires=["scipy<1.14"], but cibuildwheel installs the wheel-under-test (resolving its deps) *before* test-requires runs. So on Linux the wheel install still pulled the latest scipy (no manylinux2014 wheel) and compiled it from source -> "OpenBLAS not found"; and on Windows cp38 the late `pip install scipy<1.14` tried to build scipy 1.13 (no cp38 support). Set PIP_ONLY_BINARY=scipy in the cibuildwheel step env and forward it into the manylinux container via CIBW_ENVIRONMENT_PASS_LINUX, so scipy resolves from a (slightly older) binary wheel during the wheel install on every platform. Scoped to scipy so it never blocks building hapc itself from source. macOS universal2 already passed and is unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
✅ Dry run green on all platforms — run 27556644116 (workflow_dispatch on this branch; publish job correctly skipped since it's not a tag). Linux wheels now build, auditwheel-repair, and pass the Plus macOS universal2 (x86_64+arm64), Windows AMD64, and the sdist. Issues found and fixed during the dry runs (beyond the original CI swap):
Ready to merge; tag |
Patch release shipping Linux manylinux2014 wheels (cp38-cp312) for the first time, alongside the existing macOS (universal2) and Windows wheels, via the cibuildwheel-based CI. No library code changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PyPI
hapc2.3.0 ships wheels for macOS and Windows (cp38–cp312) but no Linux wheel — only the sdist. So on any Linux box, including every HPC cluster,pip install hapcfalls back to compiling from source (the GLIBC_2.29 / sysroot /timespec_get/LIBRARY_PATHpain).Root cause
The v2.3.0 workflow run reported success yet the Linux jobs produced zero wheels:
docker://quay.io/pypa/manylinux2014_x86_64step started;yum install eigen3-develsucceeded./opt/python/*/bin, but the[[ $PYBIN == *cp38* || ... ]]match never fired →pip wheelnever ran →dist/stayed empty.upload-artifacthit an emptydist/and only warned (No files were found with the provided path: dist/) — a warning, not an error — so the job went green.publish-to-pypithen published whatever artifacts existed: mac + win wheels + sdist. No Linux wheel.Fix
pypa/cibuildwheel@v2.23.3— one job per OS, builds + repairs (auditwheel/delocate/delvewheel) all CPython ABIs (cp38–cp312).macos-13) + Apple Silicon (macos-14) native builds (no universal2 cross-compile gotcha, saner deployment target than the currentmacosx_15_0).import hapc) before publish — catches wrong-ABI / unresolved-symbol wheels.if-no-files-found: erroron the wheel upload, and a publish-time step that aborts unless a*manylinux*_x86_64.whlis present.[tool.cibuildwheel]inpyproject.toml→ reproducible locally viapipx run cibuildwheel.--no-binaryfor air-gapped nodes); fixyourusernameplaceholder URLs →meixide.Validation
pyproject.toml+ workflow YAML parse cleanly.cibuildwheel --print-build-identifiers --platform linux→cp3X-manylinux_x86_64.pip wheel . --no-deps, build isolation pulling pybind11/cmake) produced a working wheel — the exact per-interpreter step cibuildwheel drives.How to ship
workflow_dispatch— builds + smoke-tests wheels on all OSes; the publish job is gated onrefs/tags/, so nothing uploads.v2.3.1to publish the full wheel set including Linux. (2.3.0files already exist on PyPI andtwine --skip-existingwon't overwrite.)Deferred (optional follow-ups)
numpy<2.3ceiling in a later release.🤖 Generated with Claude Code