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

Appearance settings

macOS built Python3.11b5 can't find lib-dynload in relocatable framework if framework is relocated and python run from external symlink #95400

Copy link
Copy link
@jpgarcia-ssec

Description

@jpgarcia-ssec
Issue body actions

Bug report

A build of Python 3.11b5's fails to find lib-dynload path if the following normally ok combination of criteria are met:

  • The framework is made or modified in such a away to be relocatable (dynamic links are relative using @loader_path, etc) instead of absolute path
  • The framework is installed in a location it wasn't built at
  • python is executed by a symlink from elsewhere

Your environment

To reproduce this easily, I decompressed the installable package into my home directory, making a framework structure that would normally run. I do have to modify the linking to work relocated, using the following commands:

 install_name_tool -change /Library/Frameworks/Python.framework/Versions/3.11/Python @loader_path/../Python Python.framework/Versions/3.11/bin/python3.11
 install_name_tool -change /Library/Frameworks/Python.framework/Versions/3.11/Python @loader_path/../../../../Python Python.framework/Versions/3.11/Resources/Python.app/Contents/MacOS/Python

I then symlink the python executable.

ln -s Python.framework/Versions/3.11/bin/python3.11 python3.11

the following command works fine

./Python.framework/Versions/3.11/bin/python3.11 -c "import math"

while this does not

 ./python3.11 -c "import math"
Could not find platform dependent libraries <exec_prefix>
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'math'

even though the shell itself works normally, just the lib-dynload is not being found.

I can make it work with the attached patch, but I don't assume it is the correct way to fix it
relocated_framework.patch.gz
.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-macbuildThe build process and cross-buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.