Repository navigation
OpenSSL provides required ssl module APIs... no #57
Copy link
Copy link
Closed
Description
Ubuntu 18.0.4
uname -m: aarch64
Running in docker on M1 mac
portable-python v1.9.6
building 3.12.3
portable-python.yaml
linux:
allowed-system-libs: /lib/.*
cpython-modules: openssl
Openssl seems to build fine
install libcrypto.a -> /home/root/build/deps/lib/libcrypto.a
install libssl.a -> /home/root/build/deps/lib/libssl.a
created directory `/home/root/build/deps/lib/pkgconfig'
install libcrypto.pc -> /home/root/build/deps/lib/pkgconfig/libcrypto.pc
install libssl.pc -> /home/root/build/deps/lib/pkgconfig/libssl.pc
install openssl.pc -> /home/root/build/deps/lib/pkgconfig/openssl.pc
"/usr/bin/make" depend && "/usr/bin/make" _build_modules
make[1]: Entering directory '/home/root/build/components/openssl'
make[1]: Leaving directory '/home/root/build/components/openssl'
make[1]: Entering directory '/home/root/build/components/openssl'
make[1]: Nothing to be done for '_build_modules'.
make[1]: Leaving directory '/home/root/build/components/openssl'
created directory `/home/root/build/deps/lib/engines-3'
*** Installing engines
created directory `/home/root/build/deps/lib/ossl-modules'
*** Installing modules
install providers/legacy.so -> /home/root/build/deps/lib/ossl-modules/legacy.so
"/usr/bin/make" depend && "/usr/bin/make" _build_programs
make[1]: Entering directory '/home/root/build/components/openssl'
make[1]: Leaving directory '/home/root/build/components/openssl'
make[1]: Entering directory '/home/root/build/components/openssl'
make[1]: Nothing to be done for '_build_programs'.
make[1]: Leaving directory '/home/root/build/components/openssl'
created directory `/home/root/build/deps/bin'
*** Installing runtime programs
install apps/openssl -> /home/root/build/deps/bin/openssl
install tools/c_rehash -> /home/root/build/deps/bin/c_rehash
INFO Compiling openssl took 1 minute 41 seconds
And it finds the headers but the not the libs, or the libs are incompatible?
checking for include/openssl/ssl.h in /home/root/build/deps... yes
checking whether compiling and linking against OpenSSL works... yes
checking for --with-openssl-rpath...
checking whether OpenSSL provides required ssl module APIs... no
checking whether OpenSSL provides required hashlib module APIs... no
Leading to no SSL support
The necessary bits to build these optional modules were not found:
_curses _curses_panel _dbm
_gdbm _hashlib _ssl
_tkinter readline
To find the necessary bits, look in configure.ac and config.log.
Could not build the ssl module!
Python requires a OpenSSL 1.1.1 or newer
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
solvingj commentedon Feb 3, 2025
I tried downgrading openssl to 1.1.1w, and then 1.1.1u and get the same issue.
Also tried Python 3.11.10 and same issue.
solvingj commentedon Feb 3, 2025
Just as a sanity check, i removed:
cpython-modules: opensslAnd now it reports yes to these checks:
So then I restored it and switched to 1.1.1n which is the same version the system has and they still report no.
The .pc files all look right so I'm running out of ideas.
solvingj commentedon Feb 3, 2025
@zsimic am I misunderstanding something fundamental?
My expectation is that:
The net effect of this statement is that OpenSSL will be compiled from source and statically linked in:
configureshould reportyesin these lines when doing so, and that it's a problem that it reportsno:Because it seems to me that everything is happening properly.
OpenSSL's build is installing the static libs and the
.pcfiles:And we know Python's
configurescript is using the.pcfiles because it finds the headers successfully:And it seems to me the problem is that it's not finding the symbols inside:
I feel I must be missing something because otherwise static linking like this should never have worked properly for anyone.
solvingj commentedon Feb 3, 2025
Ok bit of a surprise here. I found the following in
components/cpython/config.logindicating it's not even the opensslsymbolsit's failing to find, but thedlsymbols:It's got
-ldlwhich is the common reason for these errors, so will see what else i can find.solvingj commentedon Feb 3, 2025
Ok, I traced this down and have some feedback.
This does appear to be a problem specific to openssl and static linking, which will be platform specific. So far i've only tested on linux arm (
aarch64), later today i'll test linux x86.The fundamental thing I had wrong was that it was actually missing openssl symbols, specifically the ones which are loaded dynamically, as part of the DSO/Engines system.
This seems to be a known potential problem with static linking openssl into python based on this comment in the Python
configure.acfile:https://github.com/python/cpython/blob/main/configure.ac#L7314-L7333
I was able to workaround this issue by disabling openssl's
dsofeature, by patching the code to addingno-dsohere:https://github.com/codrsquad/portable-python/blob/main/src/portable_python/external/xcpython.py#L161
I don't believe additional configure flags for deps is exposed to the config the way the version is, but that would be great. Would that be supportable in the future?
zsimic commentedon Feb 14, 2025
Release with portable-python v1.9.8