scikit-build / cmake-python-distributions

This project provides the infrastructure to build CMake Python wheels.
https://cmake-python-distributions.readthedocs.io
Apache License 2.0
113 stars 34 forks source link

FreeBSD wheels #335

Open rhelmot opened 1 year ago

rhelmot commented 1 year ago

Several python projects I work with list cmake in their pyproject.toml install_requires section. This is incredibly awkward on freebsd because there are no wheels available, and thus cmake has to be built from source. This takes a while, which is undesirable.

Would it be appreciated if I contributed a CI pass to build wheels for FreeBSD?

henryiii commented 1 year ago

FreeBSD does not support redistributable wheels at all. There is no backward compatibility guarantee for wheels, or cross-BSD guarantee, so there can't be a "manybsd" image. You can't upload them to PyPI. If you want to work on wheels, that's where you'd have to start - propose a PEP for "manybsd", get gaurentees about being able to build binaries that support all future versions of all the BSDs, propose a tag name for it in a PEP, and add support for it to pip, PyPI, packaging, etc. This was done for musllinux a couple of years ago, so it's possible (but it relies on the compatibility guarantees I mentioned, which I've been told won't happen for BSD).

The problem is that packages shouldn't list cmake or ninja in your pyproject.toml at all. You should use something like scikit-build-core's mechanism, which only adds cmake if it's not installed via PEP 517 hooks. There's even a guide for doing this yourself in https://scikit-build.readthedocs.io/en/latest/usage.html#adding-cmake-as-building-requirement-only-if-not-installed-or-too-low-a-version.