Skip to content

Commit

Permalink
hooks: cryptography: work-around for systems with musl libc
Browse files Browse the repository at this point in the history
Add a work-around for resolution of path to OpenSSL 3.x shared library
on systems with musl libc (e.g., Alpine linux). Such systems do not
have ldconfig cache available, and due to oversight, the fallback
library search codepath in PyInstaller <= 6.6 assumes that the given
library name has no suffix.
  • Loading branch information
rokm committed Apr 22, 2024
1 parent 8d14a00 commit a0cbbc2
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ def _check_cryptography_openssl3():
# Linux and other POSIX systems
lib_name = 'libssl.so.3'
openssl_lib = bindepend.resolve_library_path(lib_name)
if openssl_lib is None and compat.is_musl:
# Work-around for bug in `bindepend.resolve_library_path` in PyInstaller 6.x, <= 6.6; for search without
# ldconfig cache (for example, with musl libc on Alpine linux), we need library name without suffix.
lib_name = 'libssl'
openssl_lib = bindepend.resolve_library_path(lib_name)
else:
logger.warning(
"hook-cryptography: full support for cryptography + OpenSSL >= 3.0.0 requires PyInstaller >= 6.0"
Expand Down

0 comments on commit a0cbbc2

Please sign in to comment.