python / cpython

The Python programming language
https://www.python.org
Other
62.17k stars 29.88k forks source link

Python-3.12.4 can not find OpenSSL in /usr/local #121908

Open blastwave opened 1 month ago

blastwave commented 1 month ago

Bug report

Bug description:

Trivial attempt to compile Python from source fails over and over in that it
can not locate OpenSSL in the "prefix" directory /usr/local .

The configure was entirely trivial : 

 ./configure --prefix=/usr/local --with-openssl=/usr/local 

Does OpenSSL exist ?

o# 
o# which openssl
/usr/local/bin/openssl
o# openssl version 
OpenSSL 3.3.1 4 Jun 2024 (Library: OpenSSL 3.3.1 4 Jun 2024)
o# 

Yep .. it is right there. Dead easy.

However a compile fails over and over and over with the same message : 

Following modules built successfully but were removed because they could not be imported:
_ssl                                                           

Could not build the ssl module!
Python requires a OpenSSL 1.1.1 or newer

So this has to be a bug in the build system somewhere.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

blastwave commented 1 month ago
Without being boring the configure step *only* works flawlessly if and only if
one specifies where the OpenSSL RPATH/RUNPATH should be : 

 ../Python-3.12.4/configure --prefix=/usr/local --enable-shared --with-openssl-rpath=/usr/local/lib --with-openssl=/usr/local 

Then we see this stuff :  

.
.
.
checking for include/openssl/ssl.h in /usr/local... yes
checking whether compiling and linking against OpenSSL works... yes
checking for --with-openssl-rpath... /usr/local/lib
checking whether OpenSSL provides required ssl module APIs... yes
checking whether OpenSSL provides required hashlib module APIs... yes
.
.
.

Pretty silly really.