[openwrt-23.05] python3: Restore platform triplet to paths #22048
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.