Repository navigation
Conversation
Use MODSHARED_NAMES in PYTHON.json within the distribution to determine which extentions should be shared when performing validation. For Python 3.10 use a hard-coded list as MODSHARED_NAMES does not exist. Keep existing logic for Windows and static builds.
On macOS, Python 3.12+, apply -hidden-l to the per-module linker flags as well as MODLIBS. This keeps shared extensions from exporting symbols from bundled static libraries.
Shared extensions can require newer glibc symbols than libpython. Scan both libpython and the shared objects in lib-dynload with objdump and record the highest GLIBC symbol version found.
Build standard library extensions as shared by default while continuing to statically link in any external libraries (openssl, zlib, etc). This reduces the size of python and libpython and is more in line with upstream defaults. Static build continue to statically link all extensions.
Test that the _io, math, _ssl and _sqlite modules are loaded in the manner expected by the extension and built option.
Collaborator
|
Thank you for undoing this longstanding PyOxidizer kludge! |
Backport CPython PR #116294 to Python 3.11 and 3.12. Use _PYTHON_SYSCONFIGDATA_PATH to load the target configuration without adding the target build directory to PYTHONPATH. On macOS, ARM64 and x86-64 extensions have the same filename suffix. Keeping their import paths separate prevents the ARM64 build interpreter from trying to load x86-64 extensions.
Contributor
Author
|
There is a race condition in the 3.11 builds where two installers write to the same extension file. This only rarely caused builds failures when extensions where statically linked but seems to occur more often with shared extensions. A one-line patch to Makefile can address this. |
Contributor
Author
|
There may be an issue with statically linking libcurses into both |
This branch has not been deployed
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.
Build and install most standard-library extensions as shared libraries on Linux and macOS. Bundled libraries, OpenSSL, sqlite, etc, are statically linked into the appropriate extension. Fully-static distribution continue to statically link extensions into
pythonandlibpython.Validate the link nature using
MODSHARED_NAMESfrom thepython/PYTHON.jsonfile within the distribution for Python 3.11+. Use the a hardcoded fallback for 3.10. Test a handful of module as part of disttests.This significantly reduces the size of
pythonandlibpythonas the codepaths are moved to external shared libaries. The total distribution size is also reduced because these codepaths are no longer duplicated inpythonandlibpython. In an aarch64 3.15 debug build the install directory was reduced by ~15% although the savings for the.tar.zstdis a more modest 3% and 7% for Linux and macOS.