NetBSD Problem Report #56167
From triaxx@netbsd.org Fri May 14 14:34:57 2021
Return-Path: <triaxx@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 3A30B1A9243
for <gnats-bugs@gnats.NetBSD.org>; Fri, 14 May 2021 14:34:57 +0000 (UTC)
Message-Id: <20210514143455.796881A9287@mollari.NetBSD.org>
Date: Fri, 14 May 2021 14:34:55 +0000 (UTC)
From: triaxx@netbsd.org
Reply-To: triaxx@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: lang/python39 build failure on FreeBSD 12
X-Send-Pr-Version: 3.95
>Number: 56167
>Category: pkg
>Synopsis: lang/python39 build failure on FreeBSD 12
>Confidential: no
>Severity: critical
>Priority: low
>Responsible: pkg-manager
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 14 14:35:00 +0000 2021
>Closed-Date: Thu May 20 06:57:42 +0000 2021
>Last-Modified: Thu May 20 07:00:02 +0000 2021
>Originator: Frédéric Fauberteau
>Release: FreeBSD 12.2-RELEASE-p6
>Organization:
>Environment:
System: FreeBSD cocoon.triaxx.org 12.2-RELEASE-p6 FreeBSD 12.2-RELEASE-p6 GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
The release 3.9.5 of Python fails during the building step.
The following error is reported by the building application:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
building '_ssl' extension
clang -fPIC -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -I/usr/include -I/usr/pkg/include -O2 -I/usr/include -I/usr/pkg/include -O2 -I/usr/include -I/usr/pkg/include -std=gnu99 -Wextra -Wno-unused-result -Wno-unused-p
arameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I/usr/include -I./Include -I. -I/usr/include -I/usr/pkg/include -I/usr/pkgsrc/lang/python39/work/P
ython-3.9.5/Include -I/usr/pkgsrc/lang/python39/work/Python-3.9.5 -c /usr/pkgsrc/lang/python39/work/Python-3.9.5/Modules/_ssl.c -o build/temp.freebsd-12.2-RELEASE-p6-amd64-3.9/usr/pkgsrc/lang/python39/work/Python-3.9.5/Modules/_ssl.o
In file included from /usr/pkgsrc/lang/python39/work/Python-3.9.5/Modules/_ssl.c:43:
In file included from /usr/pkgsrc/lang/python39/work/Python-3.9.5/Modules/socketmodule.h:116:
In file included from /usr/include/bluetooth.h:54:
/usr/include/netgraph/bluetooth/include/ng_btsocket.h:244:2: warning: "Make sure new member of socket address initialized" [-W#warnings]
#warning "Make sure new member of socket address initialized"
^
/usr/pkgsrc/lang/python39/work/Python-3.9.5/Modules/_ssl.c:3116:27: error: implicit declaration of function 'SSLv3_method' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
ctx = SSL_CTX_new(SSLv3_method());
^
/usr/pkgsrc/lang/python39/work/Python-3.9.5/Modules/_ssl.c:3116: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.
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_gdbm _tkinter spwd
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc atexit pwd time
Failed to build these modules:
_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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It results an error during the installation step:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=> Checking file-check results for python39-3.9.5
ERROR: ************************************************************
ERROR: The following files are in the PLIST but not in /usr/pkgsrc/lang/python39/work/.destdir/usr/pkg:
ERROR: /usr/pkgsrc/lang/python39/work/.destdir/usr/pkg/lib/python3.9/lib-dynload/_ssl.so
*** Error code 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>How-To-Repeat:
cd /usr/pkgsrc/lang/python39 && bmake install
>Fix:
$NetBSD$
Fix build failure on FreeBSD 12.
From https://github.com/python/cpython/commit/3309113
--- _ssl.c.orig 2021-05-14 15:52:07.251636000 +0200
+++ _ssl.c 2021-05-14 15:52:37.012941000 +0200
@@ -151,6 +151,9 @@
* unless OpenSSL is compiled without the methods. It's the easiest way to
* make 1.0.2, 1.1.0, 1.1.1, and 3.0.0 happy without deprecation warnings.
*/
+#ifndef OPENSSL_NO_SSL3_METHOD
+extern const SSL_METHOD *SSLv3_method(void);
+#endif
#ifndef OPENSSL_NO_TLS1_METHOD
extern const SSL_METHOD *TLSv1_method(void);
#endif
>Release-Note:
>Audit-Trail:
From: Frederic Fauberteau <triaxx@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/56167: lang/python39 build failure on FreeBSD 12
Date: Fri, 14 May 2021 16:55:45 +0200
>> Fix:
> $NetBSD$
>
> Fix build failure on FreeBSD 12.
> From https://github.com/python/cpython/commit/3309113
>
> --- _ssl.c.orig 2021-05-14 15:52:07.251636000 +0200
> +++ _ssl.c 2021-05-14 15:52:37.012941000 +0200
> @@ -151,6 +151,9 @@
> * unless OpenSSL is compiled without the methods. It's the easiest way to
> * make 1.0.2, 1.1.0, 1.1.1, and 3.0.0 happy without deprecation warnings.
> */
> +#ifndef OPENSSL_NO_SSL3_METHOD
> +extern const SSL_METHOD *SSLv3_method(void);
> +#endif
> #ifndef OPENSSL_NO_TLS1_METHOD
> extern const SSL_METHOD *TLSv1_method(void);
> #endif
>
Since mkpatches is broken on FreeBSD, I generated this patch manually and wrongly. The correct patch is:
$NetBSD$
Fix build failure on FreeBSD 12.
From https://github.com/python/cpython/commit/3309113
--- Modules/_ssl.c.orig 2021-05-14 15:52:07.251636000 +0200
+++ Modules/_ssl.c 2021-05-14 15:52:37.012941000 +0200
@@ -151,6 +151,9 @@
* unless OpenSSL is compiled without the methods. It's the easiest way to
* make 1.0.2, 1.1.0, 1.1.1, and 3.0.0 happy without deprecation warnings.
*/
+#ifndef OPENSSL_NO_SSL3_METHOD
+extern const SSL_METHOD *SSLv3_method(void);
+#endif
#ifndef OPENSSL_NO_TLS1_METHOD
extern const SSL_METHOD *TLSv1_method(void);
#endif
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/56167: lang/python39 build failure on FreeBSD 12
Date: Wed, 19 May 2021 18:05:58 +0000
On Fri, May 14, 2021 at 03:00:02PM +0000, Frederic Fauberteau wrote:
> Since mkpatches is broken on FreeBSD, I generated this patch
> manually and wrongly. The correct patch is: [...]
I don't see a difference?
anyway please just commit things like this...
--
David A. Holland
dholland@netbsd.org
From: Frederic Fauberteau <triaxx@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/56167: lang/python39 build failure on FreeBSD 12
Date: Wed, 19 May 2021 21:36:07 +0200
David Holland writes:> I don't see a difference?
The first time, I made a misuse of -p and I got:
+++ _ssl.c
instead of
+++ Modules/_ssl.c
If there is no objection, I will commit after a test on my NetBSD box when it will be available.
State-Changed-From-To: open->closed
State-Changed-By: triaxx@NetBSD.org
State-Changed-When: Thu, 20 May 2021 06:57:42 +0000
State-Changed-Why:
Fix committed.
From: =?UTF-8?B?RnLDqWTDqXJpYyBGYXViZXJ0ZWF1?= <triaxx@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/56167 CVS commit: pkgsrc/lang/python39
Date: Thu, 20 May 2021 06:56:44 +0000
Module Name: pkgsrc
Committed By: triaxx
Date: Thu May 20 06:56:44 UTC 2021
Modified Files:
pkgsrc/lang/python39: Makefile distinfo
Added Files:
pkgsrc/lang/python39/patches: patch-Modules___ssl.c
Log Message:
python39: Fix PR pkg/56167
The function implicit declaration occurs on FreeBSD 12.2 but not on
FreeBSD 13.0. The fix comes from python3.10.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 pkgsrc/lang/python39/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/lang/python39/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/python39/patches/patch-Modules___ssl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.