Skip to content

Improve missing linked library warnings - #6015

Merged
rokm merged 6 commits into
pyinstaller:developfrom
rokm:missing-linked-library-warnings
Jul 22, 2021
Merged

rokm merged 6 commits into
pyinstaller:developfrom
rokm:missing-linked-library-warnings

Conversation

@rokm

@rokm rokm commented Jul 15, 2021 •

Copy link
Copy Markdown
Member

This PR is a collection of changes that aim to improve missing-library messages generated during binary dependency scanning.

First, downgrade messages from ERROR to WARNING, because it is a pain having to explain to users that the build process did finish nevertheless and that they should try running the generated binary. (It is actually quite reasonable to assume that something has gone terribly wrong when you see that message, unless you've worked with PyInstaller before).

Display warnings for missing libraries on linux systems (i.e., libsomething.so => not found lines in ldd output). Currently, we are quietly swallowing those, which leads to issues like #5863 that would have been otherwise easy to figure out. This probably captures only output generated by glibc-based ldd on linux systems (depending on how others display missing library information), but it's a good starting point. Fixes #5863 (absence of warnings about missing libraries).

The above change now results in messages about missing libshiboken{2,6}.* when building with PySide2/PySide6 on linux (whereas on Windows and macOS, they've already been present), so this is a good opportunity to suppress that once and for all. We first add a general mechanism for suppression patterns (similar to already-existing shared library include and exclude list), and port the Windows-specific suppression of messages about missing api-ms-win-crt* DLLs.

In addition, we also suppress warning for missing ldd, which occurs on openwrt due to libc pointing to it (libc.so => ldd).

rokm added 6 commits July 15, 2021 16:25
Downgrade missing-library messages in getImports() implementations
from errors to warnings. Missing libraries do not break build
process (and may even be harmless, depending on the situation), so
error is a bit too strong word, especially as it ends up confusing
users.
Currently, we silently swallow "lib.so => not found" messages from
ldd, wheras we should probably be displaying a warning about those
libraries.

The behavior is likely linux-specific (or even glibc-specific),
but it's better than nothing.
Implement general missing-library warning suppression mechanism,
and apply it to codepaths for all OSes.
These are harmless, and are result of the shiboken2/6 shared
library residing in a separate package and not being in the
search path. Therefore, PySide2/6 extensions themselves cannot
resolve the shiboken shared library, which actually ends up
loaded when the corresponding extension from shiboken package is
loaded (and this is also how PyInstaller manages to pick it up).
Instead of importing each and every is_* member from compat, import
and use compat instead.
@rokm
rokm force-pushed the missing-linked-library-warnings branch from d267f76 to 5c1496f Compare July 15, 2021 14:26
@rokm
rokm marked this pull request as ready for review July 15, 2021 16:41
@rokm
rokm merged commit 6d08077 into pyinstaller:develop Jul 22, 2021
@rokm
rokm deleted the missing-linked-library-warnings branch July 22, 2021 16:58
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing some shared libraries when building PySide2 project inside of a debian based docker container.

2 participants