Discussion:
Build of Python 3.8.10/3.9.5 fails on 12.2-RELEASE
Yasuhiro Kimura
2021-05-10 07:29:03 UTC
Permalink
Hello,

I submitted patches to update lang/python3[89] to 3.8.10/3.9.5
respectively.

Bug 255729 - lang/python38: Update to 3.8.10
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255729
Bug 255730 - lang/python39: Update to 3.9.5
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255730

I created them on 13.0-RELEASE. But after submitting them I found
build of them fail on 12.2-RELEASE as following.

----------------------------------------------------------------------
/wrkdirs/usr/ports/lang/python38/work/Python-3.8.10/Modules/_ssl.c:3118:27: error: implicit declaration of function 'SSLv3_method' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
ctx = SSL_CTX_new(SSLv3_method());
^
/wrkdirs/usr/ports/lang/python38/work/Python-3.8.10/Modules/_ssl.c:3118:27: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const SSL_METHOD *' (aka 'const struct ssl_method_st *') [-Wint-conversion]
ctx = SSL_CTX_new(SSLv3_method());
^~~~~~~~~~~~~~
/usr/include/openssl/ssl.h:1503:47: note: passing argument to parameter 'meth' here
__owur SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
^
2 warnings and 1 error generated.
----------------------------------------------------------------------

Full build logs.

3.8.10 on 12.2-RELEASE:
https://www.utahime.org/FreeBSD/poudriere/data/logs/bulk/122amd64-default-python/2021-05-10_11h21m50s/logs/python38-3.8.10.log
3.8.10 on 13.0-RELEASE:
https://www.utahime.org/FreeBSD/poudriere/data/logs/bulk/130amd64-default-python/2021-05-10_11h24m03s/logs/python38-3.8.10.log
3.9.5 on 12.2-RELEASE:
https://www.utahime.org/FreeBSD/poudriere/data/logs/bulk/122amd64-default-python/2021-05-10_11h26m11s/logs/python39-3.9.5.log
3.9.5 on 13.0-RELEASE:
https://www.utahime.org/FreeBSD/poudriere/data/logs/bulk/130amd64-default-python/2021-05-10_11h28m01s/logs/python39-3.9.5.log

Futher, build also succeeds with 14-CURRENT and 11.4-RELEASE. So it
fails only with 12.2-RELEASE.

Since FreeBSD 12 or later use OpenSSL 1.1.1, it means build fails with
OpenSSL 1.1.1 in one case but succeeds in other cases. It seems quite
strange for me.

Any suggestions?

---
Yasuhiro Kimura
George Mitchell
2021-05-10 15:39:07 UTC
Permalink
Post by Yasuhiro Kimura
Hello,
I submitted patches to update lang/python3[89] to 3.8.10/3.9.5
respectively.
Bug 255729 - lang/python38: Update to 3.8.10
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255729
[...]
I tried your patch on python38 and did not run into your problem --
but it appears some minor updates to the pkg-plist are needed for
installation to complete. I'm trying to figure out what needs to
be changed. -- George
George Mitchell
2021-05-10 15:46:57 UTC
Permalink
Post by George Mitchell
Post by Yasuhiro Kimura
Hello,
I submitted patches to update lang/python3[89] to 3.8.10/3.9.5
respectively.
Bug 255729 - lang/python38: Update to 3.8.10
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255729
[...]
I tried your patch on python38 and did not run into your problem --
but it appears some minor updates to the pkg-plist are needed for
installation to complete.  I'm trying to figure out what needs to
be changed.                                             -- George
I left out this crucial detail: I'm running 12.2-RELEASE-p6 r369558.
-- George
George Mitchell
2021-05-10 19:44:39 UTC
Permalink
Post by George Mitchell
 > Hello,
 >
 > I submitted patches to update lang/python3[89] to 3.8.10/3.9.5
 > respectively.
 >
 > Bug 255729 - lang/python38: Update to 3.8.10
 > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255729
 > [...]
I tried your patch on python38 and did not run into your problem --
but it appears some minor updates to the pkg-plist are needed for
installation to complete.  I'm trying to figure out what needs to
be changed.                                             -- George
I left out this crucial detail: I'm running 12.2-RELEASE-p6 r369558.
-- George
After a more careful review of what I am seeing, I realize that both
my earlier messages were wrong, and I have exactly the same failure
that you originally reported. Seemingly, Python-3.8.10/Modules/_ssl.c
DOES include /usr/include/openssl/ssl.h; it does NOT have
OPENSSL_NO_SSL3_METHOD defined; and therefore SSLv3_method SHOULD be
defined, allowing _ssl.c to compile. But it doesn't, and I don't
understand why not.

tl;dr: Ignore what I said earlier. -- George
Yasuhiro Kimura
2021-05-10 22:49:07 UTC
Permalink
From: Yasuhiro Kimura <***@utahime.org>
Subject: Build of Python 3.8.10/3.9.5 fails on 12.2-RELEASE
Date: Mon, 10 May 2021 16:29:03 +0900 (JST)
Post by Yasuhiro Kimura
I submitted patches to update lang/python3[89] to 3.8.10/3.9.5
respectively.
Bug 255729 - lang/python38: Update to 3.8.10
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255729
Bug 255730 - lang/python39: Update to 3.9.5
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255730
I created them on 13.0-RELEASE. But after submitting them I found
build of them fail on 12.2-RELEASE as following.
----------------------------------------------------------------------
/wrkdirs/usr/ports/lang/python38/work/Python-3.8.10/Modules/_ssl.c:3118:27: error: implicit declaration of function 'SSLv3_method' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
ctx = SSL_CTX_new(SSLv3_method());
^
/wrkdirs/usr/ports/lang/python38/work/Python-3.8.10/Modules/_ssl.c:3118:27: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const SSL_METHOD *' (aka 'const struct ssl_method_st *') [-Wint-conversion]
ctx = SSL_CTX_new(SSLv3_method());
^~~~~~~~~~~~~~
/usr/include/openssl/ssl.h:1503:47: note: passing argument to parameter 'meth' here
__owur SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
^
2 warnings and 1 error generated.
----------------------------------------------------------------------
Full build logs.
https://www.utahime.org/FreeBSD/poudriere/data/logs/bulk/122amd64-default-python/2021-05-10_11h21m50s/logs/python38-3.8.10.log
https://www.utahime.org/FreeBSD/poudriere/data/logs/bulk/130amd64-default-python/2021-05-10_11h24m03s/logs/python38-3.8.10.log
https://www.utahime.org/FreeBSD/poudriere/data/logs/bulk/122amd64-default-python/2021-05-10_11h26m11s/logs/python39-3.9.5.log
https://www.utahime.org/FreeBSD/poudriere/data/logs/bulk/130amd64-default-python/2021-05-10_11h28m01s/logs/python39-3.9.5.log
Futher, build also succeeds with 14-CURRENT and 11.4-RELEASE. So it
fails only with 12.2-RELEASE.
Since FreeBSD 12 or later use OpenSSL 1.1.1, it means build fails with
OpenSSL 1.1.1 in one case but succeeds in other cases. It seems quite
strange for me.
Any suggestions?
I investigated repository of Python and found following commits
(bpo-43799) are the source of the problem.

[3.8] bpo-43799: OpenSSL 3.0.0: declare OPENSSL_API_COMPAT 1.1.1 (GH-25329) (GH-25383)
https://github.com/python/cpython/commit/b71aaa0df0f3a9640b034b4774651cd8c54d2fb9
[3.9] bpo-43799: OpenSSL 3.0.0: declare OPENSSL_API_COMPAT 1.1.1 (GH-25329) (GH-25382)
https://github.com/python/cpython/commit/7d9d5bf863bb0af26b74b0732ab89b2053d2fbec

I created patches to revert these commits and added them to both
ports. Then they can be built fine with 12.2-RELEASE.

---
Yasuhiro Kimura
George Mitchell
2021-05-10 23:27:11 UTC
Permalink
[...] I investigated repository of Python and found following commits
(bpo-43799) are the source of the problem.
[3.8] bpo-43799: OpenSSL 3.0.0: declare OPENSSL_API_COMPAT 1.1.1 (GH-25329) (GH-25383)
https://github.com/python/cpython/commit/b71aaa0df0f3a9640b034b4774651cd8c54d2fb9
[3.9] bpo-43799: OpenSSL 3.0.0: declare OPENSSL_API_COMPAT 1.1.1 (GH-25329) (GH-25382)
https://github.com/python/cpython/commit/7d9d5bf863bb0af26b74b0732ab89b2053d2fbec
I created patches to revert these commits and added them to both
ports. Then they can be built fine with 12.2-RELEASE.
---
Yasuhiro Kimura
[...]
Thank you! This patch works for me. -- George
Loading...