Skip to content

Commit

Permalink
Trac #34273: opensuse-tumbleweed: python3 build fails because of openssl
Browse files Browse the repository at this point in the history
Our OpenSUSE system package info leads to the installation of LibreSSL,
which is not compatible with the python3 build.

{{{
[python3-3.10.6] checking whether compiling and linking against OpenSSL
works... yes
[python3-3.10.6] checking for --with-openssl-rpath...
[python3-3.10.6] checking whether OpenSSL provides required APIs... no
[python3-3.10.6] checking for --with-ssl-default-suites... python
[python3-3.10.6] checking for --with-builtin-hashlib-hashes...
md5,sha1,sha256,sha512,sha3,blake2
[python3-3.10.6] checking for --with-experimental-isolated-
subinterpreters... no
[python3-3.10.6] checking for --with-static-libpython... yes
[python3-3.10.6] checking for --disable-test-modules... no
[python3-3.10.6] configure: creating ./config.status
}}}

Our configure script does not know that.

We update the distro file and add an additional check to openssl spkg-
configure.m4

To test: `tox -e docker-opensuse-tumbleweed-standard -- V=1 python3`

URL: https://trac.sagemath.org/34273
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Kwankyu Lee
  • Loading branch information
Release Manager committed Aug 27, 2022
2 parents 696bf78 + d46f190 commit 20d7f18
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/pkgs/openssl/distros/opensuse.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"pkgconfig(libssl)"
libopenssl-3-devel
27 changes: 24 additions & 3 deletions build/pkgs/openssl/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SAGE_SPKG_CONFIGURE([openssl], [
AX_CHECK_OPENSSL([
AC_MSG_CHECKING([whether OpenSSL >= 1.1.1, as required by PEP 644])
AC_MSG_CHECKING([whether OpenSSL >= 1.1.1, as required by PEP 644, and provides required APIs])
AC_COMPILE_IFELSE(
dnl Trac #32580: Need OpenSSL >= 1.1.1 for PEP 644
dnl From https://www.openssl.org/docs/man3.0/man3/OPENSSL_VERSION_NUMBER.html:
Expand All @@ -12,12 +12,33 @@ SAGE_SPKG_CONFIGURE([openssl], [
dnl FF is "fix"
dnl S is "status" (f = release)
dnl -> OPENSSL_VERSION_NUMBER is 0xMNNFFPPSL
dnl
dnl Trac #34273: Test program from ​https://github.com/python/cpython/blob/3.10/configure.ac#L5845
[AC_LANG_PROGRAM([[
#include <openssl/opensslv.h>
#include <openssl/evp.h>
#include <openssl/ssl.h>
#if OPENSSL_VERSION_NUMBER < 0x10101000L
# error OpenSSL >= 1.1.1 is required according to PEP 644
#error OpenSSL >= 1.1.1 is required according to PEP 644
#endif
]], [])], [
static void keylog_cb(const SSL *ssl, const char *line) {}
]], [[
/* SSL APIs */
SSL_CTX *ctx = SSL_CTX_new(TLS_client_method());
SSL_CTX_set_keylog_callback(ctx, keylog_cb);
SSL *ssl = SSL_new(ctx);
X509_VERIFY_PARAM *param = SSL_get0_param(ssl);
X509_VERIFY_PARAM_set1_host(param, "python.org", 0);
SSL_free(ssl);
SSL_CTX_free(ctx);
/* hashlib APIs */
OBJ_nid2sn(NID_md5);
OBJ_nid2sn(NID_sha1);
OBJ_nid2sn(NID_sha3_512);
OBJ_nid2sn(NID_blake2b512);
EVP_PBE_scrypt(NULL, 0, NULL, 0, 2, 8, 1, 0, NULL, 0);
]])
], [
AC_MSG_RESULT([yes])
sage_spkg_install_openssl=no
], [
Expand Down

0 comments on commit 20d7f18

Please sign in to comment.