-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add loongarch64 support #4914
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 loongarch64 support #4914
Conversation
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.
Lib/test/test_sysconfig.py
Outdated
@@ -499,7 +499,7 @@ def test_triplet_in_ext_suffix(self): | |||
import platform, re | |||
machine = platform.machine() | |||
suffix = sysconfig.get_config_var('EXT_SUFFIX') | |||
if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine): | |||
if re.match('(aarch64|arm|loongarch64|mips|ppc|powerpc|s390|sparc)', machine): |
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.
We generally don't edit this file ourselves because it mostly came from CPython.
But I understand this is necessary to correctly support the architecture.
Not to lose the changes when we update this file to new version,
Adding a comment is useful.
if re.match('(aarch64|arm|loongarch64|mips|ppc|powerpc|s390|sparc)', machine): | |
# XXX: RUSTPYTHON; loongarch64 is locally added in github #4914 | |
if re.match('(aarch64|arm|loongarch64|mips|ppc|powerpc|s390|sparc)', machine): |
And also, I found the related CPython patch doesn't include this change. Is it necessary in RustPython?
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.
Thanks for your careful review!
It is not necessary in RustPython.
Fixed.
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.
Thank you!
Hi @youknowone I fixed cargo fmt and clippy issues and ran the test for Ubuntu 22.04 x86_64:
Please review it again! Thanks, |
stdlib/src/mmap.rs
Outdated
}; | ||
|
||
#[allow(unused_imports)] |
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 is supposed to be used by #[pyattr]
#[allow(unused_imports)] | |
#[pyattr] |
Because we usually use cfg - pyattr order, placing it under cfg will be better.
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.
Fixed
stdlib/src/mmap.rs
Outdated
) | ||
) | ||
))] | ||
#[allow(unused_imports)] |
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.
#[allow(unused_imports)] | |
#[pyattr] |
The value has to be used by pyattr
to be exposed to python side
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.
I got :)
Thank you for contributing! |
Hi,
cargo build && test, all tests pass:
Please review my patch.
Thanks,
Leslie Zhai