Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

depend: exempt OSX system Tcl/Tk libs from relative path rewrite #5172

Merged
merged 2 commits into from
Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions PyInstaller/depend/dylib.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,27 @@ def match_func(pth):
"""
For system libraries is still used absolute path. It is unchanged.
"""
# Match non system dynamic libraries.
if not util.in_system_path(pth):
# Use relative path to dependent dynamic libraries based on the
# location of the executable.
return os.path.join('@loader_path', parent_dir,
os.path.basename(pth))
# Leave system dynamic libraries unchanged
if util.in_system_path(pth):
return None

# The older python.org builds that use system Tcl/Tk framework
# have their _tkinter.cpython-*-darwin.so library linked against
# /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl and
# /Library/Frameworks/Tk.framework/Versions/8.5/Tk, although the
# actual frameworks are located in /System/Library/Frameworks.
# Therefore, they slip through the above in_system_path() check,
# and we need to exempt them manually.
_exemptions = [
'/Library/Frameworks/Tcl.framework/',
'/Library/Frameworks/Tk.framework/'
]
if any([x in pth for x in _exemptions]):
return None

# Use relative path to dependent dynamic libraries based on the
# location of the executable.
return os.path.join('@loader_path', parent_dir, os.path.basename(pth))

# Rewrite mach headers with @loader_path.
dll = MachO(libname)
Expand Down
2 changes: 2 additions & 0 deletions news/5172.core.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(OSX) Exempt the ``Tcl``/``Tk`` dynamic libraries in the system framework from relative path overwrite.
Fixes missing ``Tcl``/``Tk`` dynlib on older python.org builds that still make use of the system framework.