cpython icon indicating copy to clipboard operation
cpython copied to clipboard

bpo-46498: Add new triplets for loongarch64

Open loongson-zn opened this issue 3 years ago • 5 comments

Add new triplets for loongarch64, please review, thanks! https://bugs.python.org/issue46498

https://bugs.python.org/issue46498

Signed-off-by: Zhang Na [email protected] Reviewed-by: Wang Xuerui [email protected] Reviewed-by: Wu Xiaotian [email protected] Reviewed-by: Zhu Yaliang [email protected]

loongson-zn avatar Jan 27 '22 01:01 loongson-zn

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@loongson-zn

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

the-knights-who-say-ni avatar Jan 27 '22 01:01 the-knights-who-say-ni

Every change to Python requires a NEWS entry.

Please, add it using the blurb_it Web app or the blurb command-line tool.

bedevere-bot avatar Apr 18 '22 11:04 bedevere-bot

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

bedevere-bot avatar Jun 20 '22 03:06 bedevere-bot

Okay, I'm working on it now.

loongson-zn avatar Jun 20 '22 06:06 loongson-zn

ping

cheungxi avatar Nov 10 '22 13:11 cheungxi

LoongArch toolchain conventions -- official documentation instructions, please review, thanks! @corona10 @erlend-aasland

loongson-zn avatar Mar 28 '23 03:03 loongson-zn

@loongson-zn I will take a look, but it may takes some times to review from the view of supporting this platform is proper. Please keep patient

corona10 avatar Mar 28 '23 03:03 corona10

@loongson-zn I will take a look, but it may takes some times to review from the view of supporting this platform is proper. Please keep patient

Thanks,this is debian documentation about LoongArch, we need cpython support LoongArch.

loongson-zn avatar Mar 28 '23 07:03 loongson-zn

llvm 16.0.0 kernel 5.19gcc 13.1binutils 2.40glibc 2.36 and many other projects already support LoongArch. On the other hand, I find python in the Gentoo , . /python3.11-config --extension-suffix output is .cpython-311.so, but to maintain consistency with other architectures, the output should be .cpython-311-loongarch64-linux-gnu.so. So, I think this commit should be merged as soon as possible to avoid more new questions continue to arise.

loongson-zn avatar May 06 '23 01:05 loongson-zn

rebase update

loongson-zn avatar May 06 '23 08:05 loongson-zn

Yeah, you are right. I will make corrections.

loongson-zn avatar May 06 '23 08:05 loongson-zn

Also I don't know if CPython uses DCO tags

It doesn't.

arhadthedev avatar May 06 '23 08:05 arhadthedev

Oleg, the build label is for issues, not PRs. For PRs, we clearly see which part of the code base is touched from the diff view, so build is superfluous; it only clutters the GH issue/PR search, contributing to noise. I consider the topic- labels likewise[^1]. The same logic applies: we clearly see that a PR is a topic-argument-clinic if it touches clinic.py; the clutter argument also applies.

[^1]: though the devguide says they are for issues/PRs, they are de facto used for issues, not PRs

erlend-aasland avatar May 06 '23 18:05 erlend-aasland

the build label is for issues, not PRs.

I consider the topic- labels likewise.

Thank you, got it.

arhadthedev avatar May 06 '23 19:05 arhadthedev

llvm 16.0.0 kernel 5.19gcc 13.1binutils 2.40glibc 2.36 and many other projects already support LoongArch. On the other hand, I find python in the Gentoo , . /python3.11-config --extension-suffix output is .cpython-311.so, but to maintain consistency with other architectures, the output should be .cpython-311-loongarch64-linux-gnu.so. So, I think this commit should be merged as soon as possible to avoid more new questions continue to arise.

@erlend-aasland @corona10 @arhadthedev As far as I know, LoongArch is promoting community work in Debian and Yocto. Can we consider accelerating the progress of Python's support work?

loongson-zn avatar May 08 '23 06:05 loongson-zn

Sorry for the late response: Please consider that you can meet the requirement of PEP-11

At least for tier 3, you would need at least one core dev and a reliable buildbot first.

corona10 avatar May 08 '23 06:05 corona10

Thanks,this is debian documentation about LoongArch, we need cpython support LoongArch.

My suggestion is, how about sending a downstream patch to Debian first?

corona10 avatar May 08 '23 06:05 corona10

Sorry for the late response: Please consider that you can meet the requirement of PEP-11

At least for tier 3, you would need at least one core dev and a reliable buildbot first.

PEP-11 is for platforms, not architectures?

erlend-aasland avatar May 08 '23 06:05 erlend-aasland

PEP-11 is for platforms, not architectures?

  1. Who will maintain the loongarch64-unknown-linux-gnu ?
  2. How can we verify the code for loongarch64-unknown-linux-gnu ?

I am sure that such requirements should be checked before we accept the related code from the maintenance cost view.

corona10 avatar May 08 '23 06:05 corona10

And we requested similar requirements to Windriver team too : https://mail.python.org/pipermail/python-dev/2019-January/156031.html

corona10 avatar May 08 '23 06:05 corona10

@erlend-aasland cc @loongson-zn

But on the other hand, if this is the only patch that they will need, I am okay to accept the patch anyway.

corona10 avatar May 08 '23 07:05 corona10

And we requested similar requirements to Windriver team too : https://mail.python.org/pipermail/python-dev/2019-January/156031.html

AFAICS, that's also about a platform, not an architecture ;) Anyways, this is getting too offtopic :)

erlend-aasland avatar May 08 '23 07:05 erlend-aasland

My two cents:

Who will maintain the loongarch64-unknown-linux-gnu?

Aside from the Loongson teams, there is an active community around LoongArch (also Telegram user group) with multiple porters and power users willing to help. I'm heavily involved in and contributed to many upstream projects' LoongArch support, if it helps.

How can we verify the code for loongarch64-unknown-linux-gnu?

Multiple community members regularly test out new package versions on real hardware, in addition to in-house testing by Loongson and their partners.

And with my Gentoo hat on: I regularly test Python packages as they're updated upstream. And as Gentoo heavily depends on Python, any major breakage should be noticeable once it reaches the port's userbase.

xen0n avatar May 08 '23 07:05 xen0n

Aside from the Loongson teams, there is an active community around LoongArch (also Telegram user group) with multiple porters and power users willing to help. I'm heavily involved in and contributed to many upstream projects' LoongArch support, if it helps.

Yeah, I understand how you try to support the LoongArch for various projects. But maintaining from the CPython is a different story, so what I want to confirm about accepting the patch is that all you have to do is adding a triplet, or do you need more patches in the future that include modifying CPython code with preprocessor?

corona10 avatar May 08 '23 07:05 corona10

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

bedevere-bot avatar May 08 '23 07:05 bedevere-bot

rebase update

BTW, for the CPython repo, please don't force push; use git merge --no-ff main instead :) Force-pushing does not play well with the GitHub UI. Also, we squash merge all PRs into a single commit, so it does not matter if the PR commit history is cluttered. See also the devguide.

erlend-aasland avatar May 08 '23 07:05 erlend-aasland

Aside from the Loongson teams, there is an active community around LoongArch (also Telegram user group) with multiple porters and power users willing to help. I'm heavily involved in and contributed to many upstream projects' LoongArch support, if it helps.

Yeah, I understand how you try to support the LoongArch for various projects. But maintaining from the CPython is a different story, so what I want to confirm about accepting the patch is that all you have to do is adding a triplet, or do you need more patches in the future that include modifying CPython code with preprocessor?

Thanks for clarifying. AFAICT, so far this is the only patch necessary for future binary compatibility between multiarch-aware and -unaware distributions (i.e. Debian & derivatives vs. the others). CPython itself builds and tests fine without this change; only the native extensions have different filename suffixes which is what this patch is trying to reconcile. Hence I don't think more #ifdef-ery should be necessary in the future.

Some more backgrounds though: LoongArch might need more treatment in the future if we'd want to provide perfect UX. There's two incompatible ABIs of LoongArch userland, so native libraries of different ABIs can't be interlinked without invoking UB, but Loongson wants the two ABIs (really two worlds) to share the same multiarch tuple. I expect some friction in the future if some user on one world uploads wheels to PyPI, only to be downloaded by someone on the other world, then failing at import time. It can be said to be a purely downstream problem though; most other upstream projects simply don't consider the "old world" / "ABI v1.0" to exist at all. And even if we do want to care, the changes here still apply: we've already undergone debates and this patch can be seen as the result. (This is kinda orthogonal to the issue at hand; I should probably post this elsewhere for further discussion.)

xen0n avatar May 08 '23 08:05 xen0n

@erlend-aasland cc @loongson-zn

But on the other hand, if this is the only patch that they will need, I am okay to accept the patch anyway.

@corona10 Currently, this is the only one patch. Because it affects binary compatibility, I believe it is necessary to merge as soon as possible.

loongson-zn avatar May 09 '23 03:05 loongson-zn

@corona10 Currently, this is the only one patch. Because it affects binary compatibility, I believe it is necessary to merge as soon as possible.

Okay, let's pass the CI first, I am +1 with accepting this patch.

corona10 avatar May 09 '23 06:05 corona10

Okay, let's pass the CI first, I am +1 with accepting this patch.

@corona10 Thank you for your support. I am debugging errors in CI Docs. I have asked Erlend Aasland about the reason and wating for his reply. If you could tell me the reason, I would be very grateful

loongson-zn avatar May 09 '23 07:05 loongson-zn

This error disappeared after I executed it twice on my PC.

loongson-zn avatar May 09 '23 07:05 loongson-zn