Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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:main
base:main
Choose a base branch
Loading
fromDominiqueFuchs:gh-81218-relocatable-framework-rpath

Conversation

@DominiqueFuchs
Copy link

@DominiqueFuchsDominiqueFuchs commentedJan 28, 2026
edited
Loading

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@rpath at build time because iOS builds are cross-compiled—there's no./python.exe execution, 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_path to resolve to the wrong directory, SIP stripsDYLD_FRAMEWORK_PATH from 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

  • 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()

Related

aisk reacted with thumbs up emoji
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-bot
Copy link

python-cla-botbot commentedJan 28, 2026
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@StanFromIreland
Copy link
Member

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

Reviewers

@erlend-aaslanderlend-aaslandAwaiting requested review from erlend-aaslanderlend-aasland is a code owner

@AA-TurnerAA-TurnerAwaiting requested review from AA-TurnerAA-Turner is a code owner

@emmatypingemmatypingAwaiting requested review from emmatypingemmatyping is a code owner

@corona10corona10Awaiting requested review from corona10corona10 is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Relocatable framework for macOS Enable rpath remapping in makefile

2 participants

@DominiqueFuchs@StanFromIreland

[8]ページ先頭

©2009-2026 Movatter.jp