-
-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Linux loongarch64 architecture support #1521
Conversation
✅ Deploy Preview for maturin-guide ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Does |
oh,sorry,maturin depends on target-lexicon which contains architecture related support,we should wait for that first. |
I think you can update target-lexicon now. |
Thank you so much for reminding me. Bump target-lexicon: #1579 |
What's the status now? Does |
Hi @messense
cargo test all passed:
Thanks, |
src/auditwheel/manylinux-policy.json
Outdated
@@ -488,6 +488,13 @@ | |||
"GLIBC": ["2.0", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17", "2.18", "2.22", "2.23", "2.24", "2.25", "2.26", "2.27", "2.28", "2.29", "2.30", "2.31", "2.32", "2.33", "2.34", "2.35"], | |||
"GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24", "3.4.25", "3.4.26", "3.4.27", "3.4.28", "3.4.29", "3.4.30"], | |||
"ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2", "1.2.7.1", "1.2.9"] | |||
}, | |||
"loongarch64": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file this synced with https://github.com/pypa/auditwheel/blob/main/src/auditwheel/policy/manylinux-policy.json
I don't think we should modified it by hand. Loongarch64 doesn't have manylinux support ATM right? why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @messense
Thanks for your careful review!
I don't think we should modified it by hand. Loongarch64 doesn't have manylinux support ATM right? why do we need this?
For passing the testcase pyo3_no_extension_module.
I on purpose remove x86_64 in the src/auditwheel/manylinux-policy.json
, then it is also able to reproduce the issue for Ubuntu 22.04 x86_64.
I debug the policy_is_satisfied
for x86_64 and loongarch64: https://github.com/xiangzhai/maturin/commits/pyo3_no_extension_module
It will early return via AuditWheelError::UnsupportedArchitecture
if there was no x86_64
or loongarch64
in the src/auditwheel/manylinux-policy.json
:
running 1 test
⚠️ Warning: You're building a library without activating pyo3's `extension-module` feature. See https://pyo3.rs/v0.18.1/building_and_distribution.html#linking
🔗 Found pyo3 bindings
🐍 Found CPython 3.10 at /usr/bin/python
⚠️ Warning: Couldn't find the symbol `PyInit_pyo3_no_extension_module` in the native library. Python will fail to import this module. If you're using pyo3, check that `#[pymodule]` uses `pyo3_no_extension_module` as module name
DEBUG: not found arch: x86_64 policy: manylinux_2_5 (aka manylinux1)
DEBUG: not found arch: x86_64 policy: manylinux_2_12 (aka manylinux2010)
DEBUG: not found arch: x86_64 policy: manylinux_2_17 (aka manylinux2014)
DEBUG: not found arch: x86_64 policy: manylinux_2_24
DEBUG: not found arch: x86_64 policy: manylinux_2_27
DEBUG: not found arch: x86_64 policy: manylinux_2_28
DEBUG: not found arch: x86_64 policy: manylinux_2_31
DEBUG: not found arch: x86_64 policy: manylinux_2_34
DEBUG: not found arch: x86_64 policy: manylinux_2_36
DEBUG: not found arch: x86_64 policy: manylinux_2_35
DEBUG: not found arch: x86_64 policy: linux
⚠️ Warning: No compatible platform tag found, using the linux tag instead. You won't be able to upload those wheels to PyPI.
📦 Built wheel for CPython 3.10 to test-crates/targets/pyo3_no_extension_module/pyo3_no_extension_module-2.1.0-cp310-cp310-linux_x86_64.whl
Cause: Should have errored
thread 'pyo3_no_extension_module' panicked at 'Should have errored', tests/common/mod.rs:88:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test pyo3_no_extension_module ... FAILED
failures:
failures:
pyo3_no_extension_module
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.49s
Compared with added x86_64
:
running 1 test
⚠️ Warning: You're building a library without activating pyo3's `extension-module` feature. See https://pyo3.rs/v0.18.1/building_and_distribution.html#linking
🔗 Found pyo3 bindings
🐍 Found CPython 3.10 at /usr/bin/python
⚠️ Warning: Couldn't find the symbol `PyInit_pyo3_no_extension_module` in the native library. Python will fail to import this module. If you're using pyo3, check that `#[pymodule]` uses `pyo3_no_extension_module` as module name
DEBUG: not found arch: x86_64 policy: manylinux_2_5 (aka manylinux1)
DEBUG: not found arch: x86_64 policy: manylinux_2_12 (aka manylinux2010)
DEBUG: not found arch: x86_64 policy: manylinux_2_17 (aka manylinux2014)
DEBUG: not found arch: x86_64 policy: manylinux_2_24
DEBUG: not found arch: x86_64 policy: manylinux_2_27
DEBUG: not found arch: x86_64 policy: manylinux_2_28
DEBUG: not found arch: x86_64 policy: manylinux_2_31
DEBUG: not found arch: x86_64 policy: manylinux_2_34
DEBUG: not found arch: x86_64 policy: manylinux_2_36
=>DEBUG: *found* arch: x86_64 policy: manylinux_2_35
DEBUG: dep: libpython3.10.so.1.0
DEBUG: dep: libgcc_s.so.1
DEBUG: dep: libc.so.6
DEBUG: dep: ld-linux-x86-64.so.2
DEBUG: library: libc.so.6
DEBUG: v: GLIBC_2.2.5
DEBUG: offenders len: 1
test pyo3_no_extension_module ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.47s
Could you give me some suggestion please?
Thanks,
Leslie Zhai
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any instruction for setting up a QEMU environment for loongarch64 on macOS/Linux?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for my late response! How about https://bbs.loongarch.org/d/123-linux-amd64-qemuloongarch ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That test case should be ignored on platforms that doesn't have manylinux support, I've submitted #1652 to do so.
Can you remove manylinux/musllinux related changes? Thanks!
Ah, sorry, pull request from main is difficult to work with, I'll add the commit back in another pr. |
The LoongArch architecture (LoongArch) is an Instruction Set Architecture (ISA) that has a RISC style.
Documentations:
ISA:
https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
ABI:
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
More docs can be found at:
https://loongson.github.io/LoongArch-Documentation/README-EN.html