Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jun 2026 22:17:10 +0000
From:      Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 3a5b9e2ec716 - main - devel/py-freebsd: Fix build with Python 3.12+
Message-ID:  <6a444066.3c5a8.199ece64@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3a5b9e2ec71637f88923627351cdea3b94036f5d

commit 3a5b9e2ec71637f88923627351cdea3b94036f5d
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2026-06-30 22:13:35 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2026-06-30 22:13:35 +0000

    devel/py-freebsd: Fix build with Python 3.12+
    
    cc -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -I/usr/local/include/python3.12 -c src/freebsdmodule.c -o build/temp.freebsd-15.0-RELEASE-p10-amd64-cpython-312/src/freebsdmodule.o
    In file included from src/freebsdmodule.c:172:
    In file included from src/.sources.def:7:
    src/kqueue.c:248:2: error: incompatible pointer to integer conversion initializing 'Py_ssize_t' (aka 'long') with an expression of type 'void *' [-Wint-conversion]
      248 |         PyObject_HEAD_INIT(NULL)
          |         ^~~~~~~~~~~~~~~~~~~~~~~~
    /usr/local/include/python3.12/object.h:142:9: note: expanded from macro 'PyObject_HEAD_INIT'
      142 |         (type)                   \
          |         ^~~~~~
    In file included from src/freebsdmodule.c:172:
    In file included from src/.sources.def:7:
    src/kqueue.c:556:2: error: incompatible pointer to integer conversion initializing 'Py_ssize_t' (aka 'long') with an expression of type 'void *' [-Wint-conversion]
      556 |         PyObject_HEAD_INIT(NULL)
          |         ^~~~~~~~~~~~~~~~~~~~~~~~
    /usr/local/include/python3.12/object.h:142:9: note: expanded from macro 'PyObject_HEAD_INIT'
      142 |         (type)                   \
          |         ^~~~~~
    2 errors generated.
    error: command '/usr/bin/cc' failed with exit code 1
    
    ERROR Backend subprocess exited when trying to invoke build_wheel
    *** Error code 1
    
    Reference:      https://pkg-status.freebsd.org/beefy23/data/150amd64-default/b669d2e5ce77/logs/py312-freebsd-0.9.5_1.log
---
 devel/py-freebsd/files/patch-src-kqueue.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/devel/py-freebsd/files/patch-src-kqueue.c b/devel/py-freebsd/files/patch-src-kqueue.c
new file mode 100644
index 000000000000..afca309627ff
--- /dev/null
+++ b/devel/py-freebsd/files/patch-src-kqueue.c
@@ -0,0 +1,26 @@
+--- src/kqueue.c.orig	2022-01-23 05:12:10 UTC
++++ src/kqueue.c
+@@ -245,7 +245,11 @@ static PyTypeObject KEventType = {
+ "argument for kqueue.event().";
+ 
+ static PyTypeObject KEventType = {
++#if PY_VERSION_HEX >= 0x030C0000
++	PyVarObject_HEAD_INIT(NULL, 0)
++#else
+ 	PyObject_HEAD_INIT(NULL)
++#endif
+ 	.tp_name =	"kevent",
+ 	.tp_basicsize =	sizeof(keventobject),
+ 	.tp_dealloc =	(destructor)kevent_dealloc,
+@@ -553,7 +557,11 @@ static PyTypeObject KQueueType = {
+ "per kqueue.";
+ 
+ static PyTypeObject KQueueType = {
++#if PY_VERSION_HEX >= 0x030C0000
++	PyVarObject_HEAD_INIT(NULL, 0)
++#else
+ 	PyObject_HEAD_INIT(NULL)
++#endif
+ 	.tp_name =	"kqueue",
+ 	.tp_basicsize =	sizeof(kqueueobject),
+ 	.tp_dealloc =	(destructor)kqueue_dealloc,


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a444066.3c5a8.199ece64>