Repository navigation
Use the linker to set rpath on just the python binary - #794
Merged
Merged
Conversation
This reverts commit a1af335.
Member
|
Nice, thank you! I'd like to try and find a way to combine the new |
Not the libraries in /usr/local/lib/python3.x/lib-dynload/ since they use system libraries like libssl (so `$ORIGIN/../lib` doesn't work for them)
Contributor
Author
|
I refactored |
jimnicholls
marked this pull request as draft
January 31, 2023 12:02
jimnicholls
marked this pull request as ready for review
January 31, 2023 12:24
Contributor
Author
|
@tianon, was this the direction you were thinking? I'm not wedded to either this direction or working on this myself. I'm just trying to be helpful. |
yosifkit
approved these changes
Feb 3, 2023
docker-library-bot
added a commit
to docker-library-bot/official-images
that referenced
this pull request
Feb 3, 2023
Changes: - docker-library/python@06e0db2: Merge pull request docker-library/python#794 from jimnicholls/issue-792 - docker-library/python@20c8782: Update 3.9 - docker-library/python@a09f407: Update 3.8 - docker-library/python@0048b55: Update 3.7 - docker-library/python@01cc4c0: Reuse EXTRA_CFLAGS, LDFLAGS, and PROFILE_TASK across both make invokes. - docker-library/python@b871ae1: Update 3.12-rc - docker-library/python@1b9fc11: Use the linker to change rpath for python3.x binary. - docker-library/python@adfcf63: Update 3.11 - docker-library/python@48f998b: Update 3.10 - docker-library/python@74a6eda: Revert "Only change rpath for python3.x binary"
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.
First build Python. Then re-build just the python executable with the linker flag
-rpath=$ORIGIN/../lib. With this process, the python binary does not trigger a Rosetta error.This Dockerfile demonstrates that only the python executable has a runpath set on it. The Python library and other .so files that are built as part of building Python do not have a runpath on them.
Dockerfile
docker buildx build --platform=linux/amd64 --progress=plain .
Fixes #792