build(python): publish manylinux_2_28 wheels for broader glibc compat…#1117
build(python): publish manylinux_2_28 wheels for broader glibc compat…#1117phamgialinhlx wants to merge 3 commits into
Conversation
|
All contributors have signed the DCO ✍️ ✅ |
|
I have read the DCO document and I hereby sign the DCO. |
|
recheck |
|
Hi @phamgialinhlx, thank you for your contribution. The problem this PR points at is real: the Linux wheel should not inherit an accidental glibc floor from whatever CI image happens to build it. I think the wheel-specific direction should be:
A lower-floor manylinux wheel remains installable on newer glibc systems, so I do not think we need both a This is also how projects like
I do not think the standalone musl CLI artifact should be used for the This also connects to #1456, where we are discussing the broader glibc floor for host-executed Linux binaries. For wheels, though, I think the concrete path is simpler: pick the target manylinux floor, build with maturin in that controlled environment, and publish one broadly compatible wheel per architecture. With that framing, this PR is directionally useful, but I think it should be reworked around the current CI/build structure and an explicit |
…ibility
Build released Linux wheels inside a PyPA manylinux_2_28 container so the
resulting binary runs on any Linux distribution with glibc >= 2.28
(RHEL 8, Debian 10+, Ubuntu 18.04+). The previous native build on the
noble (glibc 2.39) CI image produced manylinux_2_39 wheels that uv
refused to install on common LTS hosts such as Ubuntu 22.04.
- Add deploy/docker/Dockerfile.python-wheels-linux based on
quay.io/pypa/manylinux_2_28_{x86_64,aarch64}.
- Add build:python:wheel:linux:docker mise task and per-arch aliases.
Re-point python:build:linux:{amd64,arm64} (used by release workflows)
to the Docker-based path. The legacy native build:python:wheel:linux
task remains for fast local iteration.
- Mount the host docker socket and set up buildx in the
build-python-wheels-linux job in release-tag.yml and release-dev.yml,
mirroring the existing macOS wheel job.
- Update architecture/build-containers.md to describe the new flow.
Signed-off-by: phamgialinhlx <phamgialinhlx2@gmail.com>
…pdates Upstream deleted this file in NVIDIA#1184. Re-add it with updated Python Wheels section documenting the PyO3/maturin-action build pipeline.
3ce0d9a to
6c07d53
Compare
Summary
Build released Linux wheels inside a PyPA
manylinux_2_28container so the binary runs on any Linux distribution shipping glibc >= 2.28 (RHEL 8, Debian 10+, Ubuntu 18.04+). The previous native build on the noble (glibc 2.39) CI image producedmanylinux_2_39_x86_64wheels thatuvandpiprefuse to install on common LTS hosts such as Ubuntu 22.04 / Debian 11.Related Issue
Reported via the install path. On Ubuntu 22.04 (glibc 2.35):
Changes
deploy/docker/Dockerfile.python-wheels-linux— builds the wheel insidequay.io/pypa/manylinux_2_28_{x86_64,aarch64}. Mirrors the layer layout (manifest copy → dummy-source dep build → real source rebuild) used byDockerfile.python-wheels-macosso cargo cache mounts behave the same way. Maturin is invoked with--compatibility manylinux_2_28so the resulting wheel is tagged accordingly.tasks/python.toml:build:python:wheel:linux:docker— driver task; takesTARGETARCHandWHEEL_OUTPUT_DIR.build:python:wheel:linux:{amd64,arm64}:docker— per-arch wrappers.python:build:linux:{amd64,arm64}are re-pointed at the Docker path.build:python:wheel:linux:{amd64,arm64}tasks remain for fast local iteration (still produce a wheel tagged for the host's glibc, which is fine for dev installs)..github/workflows/release-tag.ymlandrelease-dev.yml, in thebuild-python-wheels-linuxjob:/var/run/docker.sockso the in-containermise runstep can reach the host docker daemon to launch the manylinux build.setup-buildxstep so the Dockerfile's BuildKit cache mounts (--mount=type=cache,target=/root/.cargo/registryetc.) work.build-python-wheel-macosjob, which already uses this exact pattern for its osxcross Docker build.architecture/build-containers.mdupdated to describe the new portable wheel build path and call out that the native task is now a local-iteration convenience, not the release path.The pre-existing dead
deploy/docker/Dockerfile.python-wheels(no references in any task or workflow) is left untouched to keep this PR additive — happy to remove it in a follow-up if maintainers want.Alternatives considered
maturin build --zig --compatibility manylinux_2_28(cargo-zigbuild) was the smaller-diff option but carries real risk:bundled-z3builds Z3 from C++ source via cmake, and Zig as the C++ toolchain on a heavy C++ codebase is unverified for this repo. Switching to the manylinux container keeps Z3 building under gcc-toolset-14, which is what the Z3 project itself tests against.Dockerfile.cito an older-glibc distro would let the native build produce portable wheels, but it would simultaneously affect every other job that uses the CI image. Out of scope.Testing
End-to-end validation on Ubuntu 22.04 / glibc 2.35 / Python 3.14:
docker buildx build -f deploy/docker/Dockerfile.python-wheels-linux --target wheels --build-arg TARGETARCH=amd64 …openshell-0.0.0-py3-none-manylinux_2_28_x86_64.whl(18.8 MB)uv add <wheel>into a Python 3.14 project that previously failed with the platform-tag error aboveimport openshell; openshell.SandboxClientThe build was iterated once during testing: the first attempt failed at
dnf install perl-FindBinbecause that's not a standalone package on AlmaLinux 8 (manylinux_2_28's base). Replaced withperl-core, which provides FindBin and is the canonical "full perl" meta-package on the EL family. The Z3bundled-z3build (the highest-risk piece pre-test) worked cleanly under gcc-toolset-14 inside the manylinux container.A workflow note: the docker socket mount means the linux wheel job, like the macOS wheel job, requires
/var/run/docker.sockto be present on the self-hostedbuild-amd64/build-arm64runners. That matches thecontract the macOS job already relies on.
mise run pre-commitpassesthe new task end-to-end on the next dev/tag run
Checklist
build(python): publish manylinux_2_28 wheels for broader glibc compatibilityarchitecture/build-containers.md)