PyO3 / maturin

Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages
https://maturin.rs
Apache License 2.0
4.01k stars 274 forks source link

Manylinux default version #376

Closed programmerjake closed 3 years ago

programmerjake commented 4 years ago

I encountered an issue with manylinux support for architectures not included in manylinux2010 (powerpc64le-unknown-linux-gnu for me): Maturin's argument parsing defaults to manylinux2010, which causes pip to not be able to install the built wheel:

ERROR: power_instruction_analyzer-0.2.0-cp38-cp38-manylinux2010_ppc64le.whl is not a supported wheel on this platform.

What do you think of refactoring argument parsing to pick the default manylinux version based on the target arch? something like this:

if manylinux arg passed then
    use arg
else if i686 or x86_64 then // list from PEP 571
    manylinux2010
else if armv7l or aarch64 or ppc64 or ppc64le or s390x then // list from PEP 599
    manylinux2014
else
    off
end
programmerjake commented 4 years ago

Related to #367

programmerjake commented 4 years ago

An alternative option is to just default to manylinux2014 for supported platforms (otherwise it defaults to off) and people have to explicitly use --manylinux=2010 when they really need support for such an old OS.

konstin commented 4 years ago

Sounds like a good idea! Implementation-wise, the manylinux could have an auto value that takes the lowest value currently supported. (It would be even better if we could take the lowest version the built binary supports, but unfortunately I haven't figured out how to port that auditwheel part that checks what glibc version is linked to rust)

messense commented 3 years ago

Bitten by this in https://github.com/messense/maturin/runs/1915790218?check_suite_focus=true , it happily builds maturin-0.9.1-py3-none-manylinux2010_aarch64.whl but aarch64 wheel only works on manylinux2014 and later. We should have a better default version.

messense commented 3 years ago

Fixed by #424