cibuildwheel
cibuildwheel copied to clipboard
Improve documentation: clarify how to select Linux distribution (build a wheel only for a specific distribution)
Description
I've read the documentation multiple times and I see no clear information about the following.
I have dependencies (for Pillow-SIMD) that I need to install via apt-get. How to build a wheel for Debian (we use python:3.10-slim-bullseye Docker image to run our code)? Running cibuildwheel --platform linux without extra config starts building for some other distributions.
I would be happy to submit a pull request, but I can not write something that I have no information about.
Thanks!
I think that you are looking for this section in documentation: https://cibuildwheel.readthedocs.io/en/stable/options/#linux-image
Especially if you do not build wheel for Debian or another distribution. Manylinux wheel is designed to run on any Linux that provides some set of minimal libraries. So wheel build on CentOS, should run without any problem on Debian.
Yes, while you can use manylinux_2_24, which is Debian based, that’s deprecated. I would find your deps for RHEL via yum and use manylinux2014 or manylinux_2_28. It will work on many Linux’s, including Debian. You need the special stripped and validated manylinux images to make redistributable wheels.
One more clarification:
I was able to build some wheels for Pillow-SIMD with the
before-all = "yum install ... # the list of packages here
but when it comes to musllinux, then the "yum" command not found (obviously).
Question
The documentation says something like:
Note that manylinux_2_24 builds occur inside a Debian9 docker, where manylinux2010 and manylinux2014 builds occur inside a CentOS one. So for manylinux_2_24 the CIBW_BEFORE_ALL_LINUX command must use apt-get -y instead.
I can not find how to specify packages installation so I can build all wheels. Perhaps the before-all must be specified per every architecture. Could you please clarify how it is possible to write where to use yum install ..., and where to use e.g. apk install ..., and when to use apt-get -y install...? In other words, how to map packages managers per Linux platform.
I agree to the last comment. It is not clear. My current workaround is disabling musllinux:
CIBW_SKIP: "*musllinux*"
BTW, I tried to learn what is musllinux but I cannot find it. In cibuildwheel docs there's a link to github.com/pypa/musllinux, which doesn't exists anymore.
Eventually I found this PEP: https://peps.python.org/pep-0656/
Actually, this is documented. Look at this section.
[tool.cibuildwheel.linux]
before-all = "yum install mylib"
test-command = "echo 'installed'"
[[tool.cibuildwheel.overrides]]
select = "*-musllinux*"
before-all = "apk add mylib"