Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
gh-81218: Make macOS framework builds relocatable via @rpath#144305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
DominiqueFuchs wants to merge1 commit intopython:mainChoose a base branch fromDominiqueFuchs:gh-81218-relocatable-framework-rpath
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Open
gh-81218: Make macOS framework builds relocatable via @rpath#144305
DominiqueFuchs wants to merge1 commit intopython:mainfromDominiqueFuchs:gh-81218-relocatable-framework-rpath
+26 −3
Conversation
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
macOS framework builds (--enable-framework) now produce relocatableframeworks. The installed framework can be moved to any location andwill work without requiring install_name_tool rewriting by users.This uses install-time transformation: build-time behavior is unchanged(absolute install names), and install_name_tool transforms the installedbinaries to use@rpath.Changes:- Add -headerpad_max_install_names to LINKFORSHARED and pythonw build- Transform dylib install name to@rpath at install time- Add LC_RPATH entries to installed binaries (bin/python3, Python.app)- Compute rpath depths dynamically via os.path.relpath()Signed-off-by: Dominique Fuchs <df@0x9d.net>
python-cla-botbot commentedJan 28, 2026 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Member
StanFromIreland commentedJan 28, 2026
CC@sethmlarson, the fuzzers are failing, and it doesn't seem related. |
Sign up for freeto 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.
Uh oh!
There was an error while loading.Please reload this page.
With these changes, macOS framework builds (--enable-framework) produce relocatable frameworks. The installed framework can be moved to any location and will work without requiring install_name_tool rewriting by users.
This uses install-time transformation: build-time behavior is unchanged (absolute install names), and install_name_tool transforms the installed binaries to use appropriate@rpath.
iOS target already uses
@rpathat build time because iOS builds are cross-compiled—there's no./python.exeexecution, no venvs, no shell script tests during development. macOS framework builds are different though and would break build-tree workflows because venv symlinks cause@executable_pathto resolve to the wrong directory, SIP stripsDYLD_FRAMEWORK_PATHfrom shell scripts, and so on.The install-time approach avoids all these issues, introducing no regression for build-tree workflows, follows existing patterns (CMake projects, Qt, ...) and makes the installed framework fully relocatable by default.
Changes
Related