Author Jan Wilmans
Recipients Jan Wilmans, Phillip Middleton, bkline, cayman, chris.jerdonek, christian.heimes, cjflory, cstratak, fthommen, hairygristle, joahking, kscheidegger, malektronic, simon@simonfoley.net
Date 2020-04-24.19:37:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1587757071.51.0.958206332327.issue34028@roundup.psfhosted.org>
In-reply-to
Content
I couldn't get this to work at all, python 3.7 compiled fine, but at the end it reports:

'''
*** WARNING: renaming "_ssl" since importing it failed: libssl.so.1.1: cannot open shared object file: No such file or directory
*** WARNING: renaming "_hashlib" since importing it failed: libssl.so.1.1: cannot open shared object file: No such file or directory

Python build finished successfully!

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


Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381
'''

But in the end I got it to work like this:

----- install_python3.7.sh ---- 
#!/bin/bash
set -euo pipefail

mkdir /tmp/openssl
cd /tmp/openssl
wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz
tar -xvf openssl-1.1.1a.tar.gz
cd openssl-1.1.1a
./config --prefix=/usr/local/openssl1.1.1 --openssldir=/usr/local/openssl1.1.1
make
make install
rm -rf /tmp/opensll

echo /usr/local/openssl1.1.1/lib > /etc/ld.so.conf.d/openssl1.1.1.conf
ldconfig 

mkdir /tmp/python37
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
tar xfz Python-3.7.3.tgz
cd Python-3.7.3
./configure --with-ensurepip=yes --with-openssl=/usr/local/openssl1.1.1 CFLAGS="-I/usr/local/openssl1.1.1/include" LDFLAGS="-L/usr/local/openssl1.1.1/lib" CXX=/usr/bin/g++
make
make install
rm -rf /tmp/python37

ldconfig 
--------------------

This important pieces are:

echo /usr/local/openssl1.1.1/lib > /etc/ld.so.conf.d/openssl1.1.1.conf
ldconfig 

to make it find the .so to load it at runtime and 

./configure --with-ensurepip=yes --with-openssl=/usr/local/openssl1.1.1 CFLAGS="-I/usr/local/openssl1.1.1/include" LDFLAGS="-L/usr/local/openssl1.1.1/lib" CXX=/usr/bin/g++

specifying the non-standard openssl-version specifically.
History
Date User Action Args
2020-04-24 19:37:51Jan Wilmanssetrecipients: + Jan Wilmans, christian.heimes, bkline, chris.jerdonek, cstratak, hairygristle, simon@simonfoley.net, fthommen, kscheidegger, Phillip Middleton, cayman, malektronic, cjflory, joahking
2020-04-24 19:37:51Jan Wilmanssetmessageid: <1587757071.51.0.958206332327.issue34028@roundup.psfhosted.org>
2020-04-24 19:37:51Jan Wilmanslinkissue34028 messages
2020-04-24 19:37:51Jan Wilmanscreate