Control: tags -1 + patch

On 22.01.24 21:31, Julien ÉLIE wrote:
Hi Matthias,

Package: src:inn2
Version: 2.7.2~20231223-1
Severity: serious
Tags: sid trixie ftbfs
User: debian-pyt...@lists.debian.org
Usertags: python3.12

with python3-defaults from experimental:

[...]
checking for Python.h... yes
checking for Py_Initialize... no
configure: error: in `/<<PKGBUILDDIR>>/build':
configure: error: unable to link with Python library
See `config.log' for more details

Could you put the end of the config.log file? (the part showing the failure to find Py_Initialize)

Maybe a problem of Python not in the path?


FWIW, I do not run trixie, but building INN with a downloaded version of Python 3.12 on bookworm works for me:

checking for flags to link with Python... -L/home/news/work/py3.12.1/lib -lpython3.12 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic
checking Python.h usability... yes
checking Python.h presence... yes
checking for Python.h... yes
checking for Py_Initialize... yes


configure:15028: checking for Py_Initialize
configure:15028: gcc -o conftest -g -O2 -I/home/news/work/py3.12.1/include/python3.12   conftest.c -L/home/news/work/py3.12.1/lib -lpython3.12 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic   >&5

configure:15777: checking for Py_Initialize
configure:15777: gcc -o conftest -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ff ile-prefix-map=/home/packages/tmp/inn2-2.7.2~20231223=. -flto=auto -ffat-lto-objects -fstack-pro tector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug- prefix-map=/home/packages/tmp/inn2-2.7.2~20231223=/usr/src/inn2-2.7.2~20231223-1build2 -I/usr/in clude/python3.12 -Wdate-time -D_FORTIFY_SOURCE=3 -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-o bjects -Wl,-z,relro -Wl,-z,now conftest.c -L/usr/lib/x86_64-linux-gnu -lpython3.12 -ldl -lm -lm -lm -lz -lm -lm -lexpat -lexpat Modules/_hacl/libHacl_Hash_SHA2.a -lz -Xlinker -export-dynamic - Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 >&5 /usr/bin/ld: cannot find Modules/_hacl/libHacl_Hash_SHA2.a: No such file or directory
collect2: error: ld returned 1 exit status
configure:15777: $? = 1


looking at m4/python.m4, this comes from getting the configuration out of the sysconfig module.

and _sysconfigdata_* has:

 'LOCALMODLIBS': '-lm      -lm   -lz -lm -lm   -lexpat  -lexpat     '
                 'Modules/_hacl/libHacl_Hash_SHA2.a         -lz',


So, I'm not sure, how to better get the required information for linking, but this interface doesn't look very reliable.

maybe better use: python3-config --embed --libs

patch attached.

diff -Nru inn2-2.7.2~20231223/debian/changelog inn2-2.7.2~20231223/debian/changelog
--- inn2-2.7.2~20231223/debian/changelog	2024-01-19 20:41:48.000000000 +0100
+++ inn2-2.7.2~20231223/debian/changelog	2024-01-25 16:06:27.000000000 +0100
@@ -1,3 +1,9 @@
+inn2 (2.7.2~20231223-1ubuntu1) noble; urgency=medium
+
+  * Fix configury with Python 3.12.
+
+ -- Matthias Klose <d...@ubuntu.com>  Thu, 25 Jan 2024 16:06:27 +0100
+
 inn2 (2.7.2~20231223-1build2) noble; urgency=medium
 
   * No-change rebuild with Python 3.12 as default
diff -Nru inn2-2.7.2~20231223/debian/patches/python3.12.diff inn2-2.7.2~20231223/debian/patches/python3.12.diff
--- inn2-2.7.2~20231223/debian/patches/python3.12.diff	1970-01-01 01:00:00.000000000 +0100
+++ inn2-2.7.2~20231223/debian/patches/python3.12.diff	2024-01-25 16:06:27.000000000 +0100
@@ -0,0 +1,23 @@
+--- a/m4/python.m4
++++ b/m4/python.m4
+@@ -130,10 +130,7 @@ AC_DEFUN([INN_LIB_PYTHON],
+         print(" -L".join(sysconfig.get_config_vars("LIBDIR")))'`
+      py_ldlibrary=`$PYTHON -c 'import sysconfig; \
+         print(sysconfig.get_config_vars("LDLIBRARY")@<:@0@:>@)'`
+-     py_linkage=`$PYTHON -c 'import sysconfig;                     \
+-        print(" ".join(sysconfig.get_config_vars(                  \
+-            "LIBS", "LIBC", "LIBM", "LOCALMODLIBS", "BASEMODLIBS", \
+-            "LINKFORSHARED", "LDFLAGS")))'`],
++     py_linkage=`${PYTHON}-config --embed --libs`],
+     [py_include=`$PYTHON -c 'import distutils.sysconfig; \
+         print(distutils.sysconfig.get_python_inc())'`
+      py_libdir=`$PYTHON -c 'import distutils.sysconfig; \
+@@ -142,7 +139,7 @@ AC_DEFUN([INN_LIB_PYTHON],
+         print(distutils.sysconfig.get_config_vars("LDLIBRARY")@<:@0@:>@)'`
+      py_linkage=`$PYTHON -c 'import distutils.sysconfig;           \
+         print(" ".join(distutils.sysconfig.get_config_vars(        \
+-            "LIBS", "LIBC", "LIBM", "LOCALMODLIBS", "BASEMODLIBS", \
++            "LIBS", "LIBC", "LIBM", "MODLIBS", "BASEMODLIBS", \
+             "LINKFORSHARED", "LDFLAGS")))'`])
+  PYTHON_CPPFLAGS="-I$py_include"
+  py_libpython=`AS_ECHO(["$py_ldlibrary"]) \
diff -Nru inn2-2.7.2~20231223/debian/patches/series inn2-2.7.2~20231223/debian/patches/series
--- inn2-2.7.2~20231223/debian/patches/series	2023-09-06 21:47:32.000000000 +0200
+++ inn2-2.7.2~20231223/debian/patches/series	2024-01-25 16:05:43.000000000 +0100
@@ -14,3 +14,4 @@
 no-makedbz-on-install
 motd-conffile-upgrade
 
+python3.12.diff

Reply via email to