summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorYoann Congal <yoann.congal@smile.fr>2026-03-15 23:46:32 +0100
committerPaul Barker <paul@pbarker.dev>2026-03-20 09:55:33 +0000
commit1aee6e9648661c1e6159127c2b6e4690576020f7 (patch)
treec48c9cbe19a2292d550358f65c2b0b090554b4d6 /meta/recipes-devtools
parent3a4d4d66ba65d9880e25f8e1a460008cad1f955d (diff)
downloadpoky-1aee6e9648661c1e6159127c2b6e4690576020f7.tar.gz
createrepo-c: Fix createrepo-c-native build on GCC14 hosts (e.g. Fedora 41)
This version of createrepo-c does a wrong pointer assignment, and on GCC14[0] hosts (e.g. Fedora 41), this fails to build with: FAILED: src/python/CMakeFiles/_createrepo_c.dir/createrepo_cmodule.c.o build/tmp-glibc/hosttools/gcc [...] python/createrepo_cmodule.c python/createrepo_cmodule.c:82:41: error: initialization of ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} from incompatible pointer type ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} [-Wincompatible-pointer-types] 82 | {"xml_parse_main_metadata_together",(PyCFunctionWithKeywords)py_xml_parse_main_metadata_together, | ^ src/python/createrepo_cmodule.c:82:41: note: (near initialization for ‘createrepo_c_methods[15].ml_meth’) Add a patch to fix the pointer assignment. The patched code has since been removed by upstream. [0]: https://gcc.gnu.org/gcc-14/porting_to.html#incompatible-pointer-types (From OE-Core rev: 17b1a1cd097c2bd6d690a3cd44561c2d40844088) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Paul Barker <paul@pbarker.dev>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/createrepo-c/createrepo-c/0001-Use-proper-cast-for-PyMethodDef.ml_meth.patch41
-rw-r--r--meta/recipes-devtools/createrepo-c/createrepo-c_0.19.0.bb1
2 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Use-proper-cast-for-PyMethodDef.ml_meth.patch b/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Use-proper-cast-for-PyMethodDef.ml_meth.patch
new file mode 100644
index 0000000000..fc09fdfcdd
--- /dev/null
+++ b/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Use-proper-cast-for-PyMethodDef.ml_meth.patch
@@ -0,0 +1,41 @@
1From d2dd32bcdcc717a0da48d5e983c4396ccc79fc9c Mon Sep 17 00:00:00 2001
2From: Yoann Congal <yoann.congal@smile.fr>
3Date: Sun, 15 Mar 2026 23:25:16 +0100
4Subject: [PATCH] Use proper cast for PyMethodDef.ml_meth
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9PyMethodDef.ml_meth is of PyCFunction type. Using a
10PyCFunctionWithKeywords cast for its initializer trigger build failure
11with GCC >=14 [0]:
12| FAILED: src/python/CMakeFiles/_createrepo_c.dir/createrepo_cmodule.c.o
13| build/tmp-glibc/hosttools/gcc [...] python/createrepo_cmodule.c
14| python/createrepo_cmodule.c:82:41: error: initialization of ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} from incompatible pointer type ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} [-Wincompatible-pointer-types]
15| 82 | {"xml_parse_main_metadata_together",(PyCFunctionWithKeywords)py_xml_parse_main_metadata_together,
16| | ^
17| src/python/createrepo_cmodule.c:82:41: note: (near initialization for ‘createrepo_c_methods[15].ml_meth’)
18
19Fix this by using the proper (PyCFunction) cast.
20
21[0]: https://gcc.gnu.org/gcc-14/porting_to.html#incompatible-pointer-types
22
23Upstream-Status: Inappropriate [Upstream removed the patched code in 7092ab2 (Remove python bindings for xml_parse_main_metadata_together, 2022-03-17)]
24Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
25---
26 src/python/createrepo_cmodule.c | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
28
29diff --git a/src/python/createrepo_cmodule.c b/src/python/createrepo_cmodule.c
30index c0b9200..94a206d 100644
31--- a/src/python/createrepo_cmodule.c
32+++ b/src/python/createrepo_cmodule.c
33@@ -79,7 +79,7 @@ static struct PyMethodDef createrepo_c_methods[] = {
34 METH_VARARGS, xml_parse_repomd__doc__},
35 {"xml_parse_updateinfo", (PyCFunction)py_xml_parse_updateinfo,
36 METH_VARARGS, xml_parse_updateinfo__doc__},
37- {"xml_parse_main_metadata_together",(PyCFunctionWithKeywords)py_xml_parse_main_metadata_together,
38+ {"xml_parse_main_metadata_together",(PyCFunction)py_xml_parse_main_metadata_together,
39 METH_VARARGS | METH_KEYWORDS, xml_parse_main_metadata_together__doc__},
40 {"checksum_name_str", (PyCFunction)py_checksum_name_str,
41 METH_VARARGS, checksum_name_str__doc__},
diff --git a/meta/recipes-devtools/createrepo-c/createrepo-c_0.19.0.bb b/meta/recipes-devtools/createrepo-c/createrepo-c_0.19.0.bb
index 82351252e5..dec882fddc 100644
--- a/meta/recipes-devtools/createrepo-c/createrepo-c_0.19.0.bb
+++ b/meta/recipes-devtools/createrepo-c/createrepo-c_0.19.0.bb
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
6 6
7SRC_URI = "git://github.com/rpm-software-management/createrepo_c;branch=master;protocol=https \ 7SRC_URI = "git://github.com/rpm-software-management/createrepo_c;branch=master;protocol=https \
8 file://0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \ 8 file://0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
9 file://0001-Use-proper-cast-for-PyMethodDef.ml_meth.patch \
9 " 10 "
10 11
11SRCREV = "a531ee881a8f1d9273b4383fb9fa604c56fff138" 12SRCREV = "a531ee881a8f1d9273b4383fb9fa604c56fff138"