-
Notifications
You must be signed in to change notification settings - Fork 3.7k
python3: Restore platform triplet to paths #21552
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
Conversation
exit 1 | ||
fi | ||
|
||
while IFS='|' read cmd path file_mode dir_mode; do |
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.
phew...
quite the rewrite :)
so, the platform triplet patches worry me a bit; they seem like we're starting our own Python fork downstream; i would suggest pushing these patches upstream, and then let them trickle down back if you go AWOL again for too long, and someone else needs to pick Python up again (whether it's me or someone else), the patches will be ¯\_(ツ)_/¯ |
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 would prefer to upstream the new patches
the rest of the changes are fine from my side |
I would prefer to upstream the patches as well but python/cpython#96001 has been stuck in draft status for months. I'll try pinging them again. Without the patches, the triplet will have Edit: I forgot to mention, because of how configure uses I also intentionally split my changes into separate patches to make them as understandable as possible. If someone else wants to remove them without a good explanation or demonstrating they understand what they are doing, then I would question the value of their contribution. |
BTW the various I will update commit message for "python3: Fix/expand platform triplet detection" with a reference to that list of targets. |
1e8310a
to
d7348e8
Compare
d7348e8
to
56d8042
Compare
Changes to filespec script:
|
There is no need to use Py3Package for python3 as it does not package any Python files; it is an empty package with dependencies to install the full Python installation. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* Fix default Python package description not included in individual package descriptions * Update default Python package description text (from General Python FAQ, "What is Python?") * Add package descriptions for Python module packages * Reduce duplication in package titles Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* Support wildcards in install (`+`) paths * Add fourth parameter to set directory permissions If file permissions are given (third parameter), these will now apply to files only. * Add non-recursive set permissions command (`==`) * Be more strict about filespec format Blank lines and lines starting with `#` will be ignored. Other errors (unknown command, missing path parameter, etc.) will cause the script to exit. * Be more strict about ensuring paths exist for all commands * Avoid spawning subshells This also removes outdated filespec paths in the python3 package; these paths delete files that are no longer present. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Currently, configure does not find the correct platform triplet for musl as the default build/host values passed by OpenWrt buildroot does not contain the text "linux-musl". This backports python/cpython@c163d7f to add detection for mips soft float and musl. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This removes 014-remove-platform-so-suffix.patch and 016-adjust-config-paths.patch, restoring the platform triplet to paths for: * C extensions (*.cpython-311-*.so) * Build config data directory (/usr/lib/python3.11/config-3.11-*/) * sysconfig data file (/usr/lib/python3.11/_sysconfigdata_*.py) Setting `_PYTHON_SYSCONFIGDATA_NAME` during package builds ensures that sysconfig data for target Python is loaded, in particular so that C extensions built will have the correct extension / platform triplet. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
56d8042
to
0fe1011
Compare
Updates:
|
If there are no more comments, I will merge this in a week 🙏 |
Maintainer: me
Compile tested: most/all architectures, 2023-07-09 snapshot sdks
Run tested: armsr-armv7/armsr-armv8/malta-be/x86-generic/x86-64 (qemu), 2023-07-09 snapshot
Description:
The main purpose of these changes are to restore the platform triplet to paths. The direct benefit of this would be to have setuptools-rust build successfully (and so enable building of Python packages with Rust extensions), as PyO3 expects to find the platform triplet in the _sysconfigdata file name. This should also enable maturin-based packages (see #20410) though I have not verified this / know enough about maturin to say.
I have not been able to reproduce the issues I found in #12754 regarding the platform triplet and host/target module loading; I'm not sure if this is result of changes in Python itself (there has been work done recently to improve cross-compilation), changes in our Python package build process (i.e. moving away from pip), or something else.
I'm not sure if these changes affect installing host Python packages using the previous/deprecated method (with host pip requirements files); I plan on submitting changes to downstream projects to move them toward the current process (including adding host packages here if necessary).
Please see the individual commit messages for details.