From: Thomas Weißschuh Date: Sun, 9 Jul 2023 08:18:15 +0000 (+0200) Subject: libmount: (python): work around python 3.12 bug X-Git-Tag: v2.40-rc1~337^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6cdefd733d0911e9a042e621d4f6ca55cb44505;p=thirdparty%2Futil-linux.git libmount: (python): work around python 3.12 bug Python 3.12 introduced a -Wredundant-decls warning. Work around it by not breaking the build. See https://github.com/python/cpython/issues/106560 Closes: #2366 Signed-off-by: Thomas Weißschuh --- diff --git a/configure.ac b/configure.ac index 8906e8e7fc..7e4a5b91cc 100644 --- a/configure.ac +++ b/configure.ac @@ -2637,8 +2637,14 @@ AS_IF([test "x$with_python" != xno], [ [AC_MSG_WARN([python interpreter not found, do not build python bindings])], [*:yes], # check for python development stuff - [PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION], - [have_libpython=yes], [have_libpython=no])] + [ + PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION], [have_libpython=yes], [have_libpython=no]) + + # https://github.com/util-linux/util-linux/issues/2366 + AX_COMPARE_VERSION([$PYTHON_VERSION], [ge], [3.12], [ + UL_WARN_ADD([-Wno-error=redundant-decls], [PYTHON_CFLAGS]) + ]) + ] ) ]) diff --git a/libmount/python/meson.build b/libmount/python/meson.build index 57d9a2880b..c5feb7bccd 100644 --- a/libmount/python/meson.build +++ b/libmount/python/meson.build @@ -24,7 +24,13 @@ python.extension_module( subdir : 'libmount', link_with : lib_mount, dependencies : python.dependency(), - c_args : [ '-Wno-cast-function-type' ], + c_args : [ + '-Wno-cast-function-type', + + # https://github.com/util-linux/util-linux/issues/2366 + python.language_version().version_compare('>=3.12') ? + [ '-Wno-error=redundant-decls' ] : [], + ], install : true) if build_python