depend: fix library path resolution in POSIX non-ldconfig branches #8422
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When resolving library path on POSIX systems and we do not have
ldconfig
cache available (e.g., Alpine linux), use_resolve_library_path_in_search_paths
instead of_which_library
, because the former expects the name to have (versioned) .so suffix (which is usually the case), and the latter expects the name to not have suffix. For backwards compatibility reasons, keep using_which_library
in case we are given a name without suffix.See pyinstaller/pyinstaller-hooks-contrib#724 (comment).
While we're at it, remove the replacement of resolved library's filename with its soname; because either it is the same and it is a no-op (most of the cases), or it will end up pointing to incorrect name (i.e., the other binary is referring to the library via the name we were given, so it expects to find the library under that name) which may not even exist (e.g., if the library was renamed to its current name, that differs from its soname, for whatever reason).