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

bindepend: suppress missing library messages for macOS system libraries #5464

Merged
merged 1 commit into from Jan 19, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion PyInstaller/depend/bindepend.py
Expand Up @@ -616,6 +616,7 @@ def _getImports_macholib(pth):
from macholib.MachO import MachO
from macholib.mach_o import LC_RPATH
from macholib.dyld import dyld_find
from macholib.util import in_system_path
rslt = set()
seen = set() # Libraries read from binary headers.

Expand Down Expand Up @@ -711,7 +712,12 @@ def _getImports_macholib(pth):
lib = dyld_find(lib, executable_path=exec_path)
rslt.add(lib)
except ValueError:
logger.error('Can not find path %s (needed by %s)', lib, pth)
# Starting with Big Sur, system libraries are hidden. And
# we do not collect system libraries on any macOS version
# anyway, so suppress the corresponding error messages.
if not in_system_path(lib):
logger.error('Can not find path %s (needed by %s)',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.error('Can not find path %s (needed by %s)',
logger.error('Cannot find path %s (needed by %s)',

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was thinking about changing the message. But then, it would need to be changed in other places for consistency, and that makes it out-of-scope for this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressing such tiny issue when the code is changed seems reasonable. But yes, this is a very small thing to consider, it is OK for me if you change it or not :)

lib, pth)

return rslt

Expand Down
3 changes: 3 additions & 0 deletions news/5107.bugfix.rst
@@ -0,0 +1,3 @@
(OSX) Suppress missing library error messages for system libraries as
those are never collected by PyInstaller and starting with Big Sur,
they are hidden by the OS.