https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/ Issue: sys-cluster/rdma-core-43.0 fails to compile (CYTHON3-SYSTEM). Discovered on: amd64 (internal ref: hardened_tinderbox) NOTE: (CYTHON3-SYSTEM) in the summary means that the bug was found on a machine that runs dev-python/cython-3 but this bug MAY or MAY NOT BE related to the new version of cython
Created attachment 855584 [details] build.log build log and emerge --info
Error(s) that match a know pattern in addition to what has been reported in the summary: FAILED: pyverbs/CMakeFiles/cq.cpython-310-x86_64-linux-gnu.dir/cq.c.o FAILED: pyverbs/CMakeFiles/device.cpython-310-x86_64-linux-gnu.dir/device.c.o /var/tmp/portage/sys-cluster/rdma-core-43.0/work/rdma-core-43.0_build/pyverbs/cq.c:20701:18: error: redefinition of ‘__Pyx_Enum_ibv_wc_status_to_py’
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f51bee861bf1dcb6f71897ebdad936f6bc364b0a commit f51bee861bf1dcb6f71897ebdad936f6bc364b0a Author: Sam James <sam@gentoo.org> AuthorDate: 2023-07-17 20:07:30 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-07-17 20:31:14 +0000 sys-cluster/rdma-core: add 47.0 This still fails w/ cython-3. Bug: https://bugs.gentoo.org/898734 Signed-off-by: Sam James <sam@gentoo.org> sys-cluster/rdma-core/Manifest | 1 + sys-cluster/rdma-core/rdma-core-47.0.ebuild | 111 ++++++++++++++++++++++++++++ sys-cluster/rdma-core/rdma-core-9999.ebuild | 24 ++++-- 3 files changed, 128 insertions(+), 8 deletions(-)
Issue still valid for sys-cluster/rdma-core-47.0 which fails at several places with the very same error. Text redacted for clarity : FAILED: pyverbs/CMakeFiles/wr.cpython-310-x86_64-linux-gnu.dir/wr.c.o /var/tmp/portage/sys-cluster/rdma-core-47.0/work/rdma-core-47.0_build/pyverbs/wr.c:5163:18: error: redefinition of ‘__Pyx_Enum_ibv_wr_opcode_to_py’ 5163 | static PyObject *__Pyx_Enum_ibv_wr_opcode_to_py(enum ibv_wr_opcode __pyx_v_c_val) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-cluster/rdma-core-47.0/work/rdma-core-47.0_build/pyverbs/wr.c:4067:18: note: previous definition of ‘__Pyx_Enum_ibv_wr_opcode_to_py’ with type ‘PyObject *(enum ibv_wr_opcode)’ {aka ‘struct _object *(enum ibv_wr_opcode)’} 4067 | static PyObject *__Pyx_Enum_ibv_wr_opcode_to_py(enum ibv_wr_opcode __pyx_v_c_val) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FAILED: pyverbs/CMakeFiles/wq.cpython-310-x86_64-linux-gnu.dir/wq.c.o /var/tmp/portage/sys-cluster/rdma-core-47.0/work/rdma-core-47.0_build/pyverbs/wq.c:4773:18: error: redefinition of ‘__Pyx_Enum_ibv_wq_type_to_py’ 4773 | static PyObject *__Pyx_Enum_ibv_wq_type_to_py(enum ibv_wq_type __pyx_v_c_val) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-cluster/rdma-core-47.0/work/rdma-core-47.0_build/pyverbs/wq.c:4489:18: note: previous definition of ‘__Pyx_Enum_ibv_wq_type_to_py’ with type ‘PyObject *(enum ibv_wq_type)’ {aka ‘struct _object *(enum ibv_wq_type)’} 4489 | static PyObject *__Pyx_Enum_ibv_wq_type_to_py(enum ibv_wq_type __pyx_v_c_val) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ FAILED: pyverbs/CMakeFiles/srq.cpython-310-x86_64-linux-gnu.dir/srq.c.o /var/tmp/portage/sys-cluster/rdma-core-47.0/work/rdma-core-47.0_build/pyverbs/srq.c:5528:18: error: redefinition of ‘__Pyx_Enum_ibv_ops_wr_opcode_to_py’ 5528 | static PyObject *__Pyx_Enum_ibv_ops_wr_opcode_to_py(enum ibv_ops_wr_opcode __pyx_v_c_val) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-cluster/rdma-core-47.0/work/rdma-core-47.0_build/pyverbs/srq.c:4511:18: note: previous definition of ‘__Pyx_Enum_ibv_ops_wr_opcode_to_py’ with type ‘PyObject *(enum ibv_ops_wr_opcode)’ {aka ‘struct _object *(enum ibv_ops_wr_opcode)’} 4511 | static PyObject *__Pyx_Enum_ibv_ops_wr_opcode_to_py(enum ibv_ops_wr_opcode __pyx_v_c_val) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FAILED: pyverbs/CMakeFiles/cq.cpython-310-x86_64-linux-gnu.dir/cq.c.o /var/tmp/portage/sys-cluster/rdma-core-47.0/work/rdma-core-47.0_build/pyverbs/cq.c:7679:18: error: redefinition of ‘__Pyx_Enum_ibv_wc_status_to_py’ 7679 | static PyObject *__Pyx_Enum_ibv_wc_status_to_py(enum ibv_wc_status __pyx_v_c_val) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-cluster/rdma-core-47.0/work/rdma-core-47.0_build/pyverbs/cq.c:5758:18: note: previous definition of ‘__Pyx_Enum_ibv_wc_status_to_py’ with type ‘PyObject *(enum ibv_wc_status)’ {aka ‘struct _object *(enum ibv_wc_status)’} 5758 | static PyObject *__Pyx_Enum_ibv_wc_status_to_py(enum ibv_wc_status __pyx_v_c_val) {
*** Bug 913936 has been marked as a duplicate of this bug. ***
Here is a patch proposal which solves this bug and also bug #913936 (tagged as a duplicate). I am definitely not sure about the ins and outs, my infiniband stuff is stowed in the cupboard for now so no real world tests beyond having the package being successfully compiled and installed (GCC 13.2.1_p20230826 / Cython 3.0.2). In a local ebuild override I have changed the following DEPEND statement: <dev-python/cython-3[${PYTHON_USEDEP}] for: dev-python/cython[${PYTHON_USEDEP}] Perhaps the upstream has also fixed the issue on its master branch, untested so far.
Created attachment 870263 [details, diff] Bugfix
Why drop find_package? Is it still going to regenerate the Cython files?
Honestly, I found the solution in a post reply on some chinese forum (+Google translate)... the only result I have had by Googling "redefinition of ‘__ "Pyx_Enum_ibv_wr_opcode_to_py'" (I put that source in "see also" for later reference in case of). Having no better idea, I tried to remove the nested second "if" statement as suggested (and also applying what Cython itself suggested) and... the code compiles without any failure. I am definitely not sure if it is the "true" solution or just some kind of plaster that makes the code being compiled but with some surprises later on, hence the "I am definitely not sure about the ins and outs". So to answer your question: not sure and remains to be confirmed and tested. I didn't investigate in deep details, my goal this Sunday morning was more to end a long time dependency struggle between Cython 3.0 and Cython 0.29 on my main workstation. Digging in the upstream discussion archive, nothing has (yet) been reported at first glance with regards to Cython 3. This should be brought to their attention so we can have an official fix in a future release. Perhaps some more elegant/functional solution might exists. However we have a first baseline solution for that issue on which we can elaborate on in the meantime.
I am unable to add a URL, so here where my information comes from => https://zhuanlan.zhihu.com/p/455174484 (Look for the error near the end of the page).
Issue still valid with sys-cluster/rdma-core-47.1 The very same patch solves it.
(In reply to Adrien Dessemond from comment #11) > Issue still valid with sys-cluster/rdma-core-47.1 > The very same patch solves it. The problem is, I have no expertise in rdma-core, and adding noexcept isn't necessarily right unless one audits the function and its behaviour & what callers expect. Can you submit it upstream somewhere so we get some review?
Me neither (yet), but yes I will certainly report this at upstream when I will have some time. Probably a bit later this weekend.
Ping.
Patch (not tested): https://github.com/linux-rdma/rdma-core/commit/0fa21ec991180b7bdd93562d02266cffad91b24e We also probably want https://github.com/linux-rdma/rdma-core/commit/c0377a2fc0741d3956c0cb6710b226c8539d242f and https://github.com/linux-rdma/rdma-core/commit/4dbbf9bf4adc28d425a0331ccdcc0d2c87eed4d6.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75718bfb47885c22cd8f9525c6093850e0112f5d commit 75718bfb47885c22cd8f9525c6093850e0112f5d Author: Sam James <sam@gentoo.org> AuthorDate: 2024-02-29 08:01:24 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-02-29 08:01:24 +0000 sys-cluster/rdma-core: add 50.0 Bug: https://bugs.gentoo.org/898734 Signed-off-by: Sam James <sam@gentoo.org> sys-cluster/rdma-core/Manifest | 1 + sys-cluster/rdma-core/rdma-core-50.0.ebuild | 119 ++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=950545a7b4d0a4b099a775ee1116aa7c70a9ca35 commit 950545a7b4d0a4b099a775ee1116aa7c70a9ca35 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-03-10 14:47:57 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-03-10 14:47:57 +0000 sys-cluster/rdma-core: drop 47.0-r1, 48.0 Closes: https://bugs.gentoo.org/898734 Signed-off-by: Sam James <sam@gentoo.org> sys-cluster/rdma-core/Manifest | 2 - sys-cluster/rdma-core/rdma-core-47.0-r1.ebuild | 111 ----------------------- sys-cluster/rdma-core/rdma-core-48.0.ebuild | 119 ------------------------- 3 files changed, 232 deletions(-)