Closed EwoutH closed 2 years ago
Actually Raspberry Pi by default uses 32 bit OS, so it's better to also provide armv7l wheels. Its Rust target is armv7-unknown-linux-gnueabihf
.
The Raspberry Pi 3 and 4 do both support Aarch64 though, and especially the 4 often uses is as OS. It's also a Tier 1 platform, but adding ARMv7 could still be useful for some people.
I added the armv7-unknown-linux-gnueabihf
target in 0899be2.
Oops, the current approach seems wrong, pyo3 needs PYO3_CROSS_LIB_DIR
env var to do cross compilation: https://pyo3.rs/v0.15.0/building_and_distribution.html#cross-compiling , so we need to split cross compilation jobs like this: https://github.com/milesgranger/pyrus-cramjam/blob/9692a1389d590a6eb499c87df4efbcdebccb4a25/.github/workflows/CI.yml#L153-L174
Or if startinpy is compatible with ABI3, it can be much easier: https://github.com/messense/rjieba-py/blob/d539cb7b85244cf2ec60d3b27a3a035e7b903539/.github/workflows/CI.yml#L108-L123
BTW, you need to upgrade to pyo3 0.13 or later versions to support cross compilation.
I removed the last commit, it now just adds aarch64 on Linux as the original PR intended. Lets get this in first and then figure out 32-bit builds in a next PR.
@hugoledoux ready for review
I suspect it's not going to work for aarch64 wheel, it may contain a x86_64 .so
file in it. I suggest try to add a run-on-arch
step to verify it's import
able, see https://github.com/messense/rjieba-py/blob/d539cb7b85244cf2ec60d3b27a3a035e7b903539/.github/workflows/CI.yml#L124-L142
Edit: Opened https://github.com/PyO3/maturin/issues/679 to track the potential issue.
@messense I understand, thanks for looking into this! I will mark this PR as draft until PyO3/maturin#679 is resolved.
BTW, you need to upgrade to pyo3 0.13 or later versions to support cross compilation.
Try upgrade to pyo3 0.15.0 first, I think https://github.com/PyO3/maturin/issues/679 is already covered in pyo3.
This PR contains two commits:
aarch64-unknown-linux-gnu
targets to the build matrix.Linux aarch64 wheels are nice for people using ARMv8 systems, like Raspberry Pi's and such. I also tried Windows Arm64 builds, but those failed unfortunately.