python3: Use default _PYTHON_HOST_PLATFORM#12754
Merged
neheb merged 1 commit intoopenwrt:masterfrom Jul 8, 2020
Merged
Conversation
This lets the Python build process set _PYTHON_HOST_PLATFORM instead of forcing an explicit value. Also: * Save the target _PYTHON_HOST_PLATFORM value during Build/InstallDev for use when building target Python packages (in python3-package.mk). * Use the (mostly) default PYTHON_FOR_BUILD value, instead patch configure to remove the platform triplet from the sysconfigdata file name. * Remove the "CROSS_COMPILE=yes" make variable (there is no indication that this variable is necessary). * Force host pip to build packages from source instead of downloading binary wheels. Previously, host pip can download universal (platform-independent) wheels but not platform-specific wheels, because of the custom _PYTHON_HOST_PLATFORM value. (Packages that do not have universal wheels would be compiled from source.) With a correct _PYTHON_HOST_PLATFORM, host pip can install platform-specific wheels as well. However, the pre-built shared object (.so) files in these wheels will have the host's platform triplet in their file names. When target Python packages are built (using the target's _PYTHON_HOST_PLATFORM), Python will not use these shared object files. By forcing host pip to build packages from source, the built shared object files will not have the platform triplet in their file names. (Host Python has been patched to remove the platform triplet from file names.) This allows these packages to be used when building target Python packages. (The net effect of this complete change is that platform-dependent packages will continue to be compiled from source, while platform-independent packages will now also be compiled from source.) Signed-off-by: Jeffery To <jeffery.to@gmail.com>
commodo
approved these changes
Jul 8, 2020
Member
Author
|
This is #12755 but for master, because:
I should note that removing |
Member
Author
|
Also, an unrelated note: I noticed there are lots of build-specific file paths in _sysconfigdata.py. We may need to look at it in the future to improve reproducibility of the Python package itself. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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, @commodo
Compile tested: armvirt-64, 2020-07-05 snapshot sdk
Run tested: armvirt-64 (qemu), 2020-07-05 snapshot
Description:
This lets the Python build process set
_PYTHON_HOST_PLATFORMinstead of forcing an explicit value.Also:
Save the target
_PYTHON_HOST_PLATFORMvalue duringBuild/InstallDevfor use when building target Python packages (in python3-package.mk).Use the (mostly) default
PYTHON_FOR_BUILDvalue, instead patch configure to remove the platform triplet from the sysconfigdata file name.Remove the
CROSS_COMPILE=yesmake variable (there is no indication that this variable is necessary).Force host pip to build packages from source instead of downloading binary wheels.
Previously, host pip can download universal (platform-independent) wheels but not platform-specific wheels, because of the custom
_PYTHON_HOST_PLATFORMvalue. (Packages that do not have universal wheels would be compiled from source.)With a correct
_PYTHON_HOST_PLATFORM, host pip can install platform-specific wheels as well. However, the pre-built shared object (.so) files in these wheels will have the host's platform triplet in their file names. When target Python packages are built (using the target's_PYTHON_HOST_PLATFORM), Python will not use these shared object files.By forcing host pip to build packages from source, the built shared object files will not have the platform triplet in their file names. (Host Python has been patched to remove the platform triplet from file names.) This allows these packages to be used when building target Python packages.
(The net effect of this complete change is that platform-dependent packages will continue to be compiled from source, while platform-independent packages will now also be compiled from source.)
Signed-off-by: Jeffery To jeffery.to@gmail.com