Skip to content

Conversation

@jefferyto
Copy link
Member

Maintainer: me
Compile tested: none (cherry picked from #21552)
Run tested: none

Description (copied from #21552):
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.

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 <[email protected]>
(cherry picked from commit 87631ec)
* 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 <[email protected]>
(cherry picked from commit 329f9a1)
* 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 <[email protected]>
(cherry picked from commit 2ffb877)
Signed-off-by: Jeffery To <[email protected]>
(cherry picked from commit b595362)
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 <[email protected]>
(cherry picked from commit 5a0055d)
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 <[email protected]>
(cherry picked from commit 0fe1011)
@jefferyto jefferyto added the OpenWrt 23.05 (end of support) Issue/PR on branch 23.05 label Sep 5, 2023
@1715173329 1715173329 merged commit 12d65de into openwrt:openwrt-23.05 Sep 12, 2023
@jefferyto jefferyto deleted the python-platform-triplet-openwrt-23.05 branch September 12, 2023 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OpenWrt 23.05 (end of support) Issue/PR on branch 23.05

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants