borgbackup / borg

Deduplicating archiver with compression and authenticated encryption.
https://www.borgbackup.org/
Other
11.21k stars 743 forks source link

(Optionally) use a proper build system #2422

Open enkore opened 7 years ago

enkore commented 7 years ago

setuptools' Extension with custom Cython steps "kind of" works, but has many restrictions and annoyances:

Problems using non-setup.py setup:

RonnyPfannschmidt commented 7 years ago

if you set up a way to do setup.py build with the shell out it should be fine - for a good measure try to get to the point where you can build wheels

enkore commented 7 years ago

Turns out that there already is tooling for glueing CMake into setup.py: http://scikit-build.readthedocs.io/en/latest/

The scikit-build package is fundamentally just glue between the setuptools Python module and CMake. Currently, the package is available to perform builds in a setup.py file. In the future, the project aims to be a build tool option in the currently developing pyproject.toml build system specification.

In that case it may be possible to just always build using CMake, which would be rather nice (much better than Extension anyway). Having CMake as a build requirement is no big deal.

enkore commented 7 years ago

Note: A proper build system would allow us to use the better CRC32 routines (crc32_clmul.c) on more platforms than just GCC (sans OpenBSD, not including anything clang!).

The same argument would apply to shipping other routines, e.g. there are BLAKE2 implementations using AVX2 which are 30-40 % faster on Haswell and later than the scalar (but ILP-heavy-by-design) code we use now; but it's impossibleā„¢ to ship that using setup.py. Or at least overly difficult and annoying.