Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 898734 - sys-cluster/rdma-core-43.0 fails to compile (CYTHON3-SYSTEM): cq.c:20701:18: error: redefinition of __Pyx_Enum_ibv_wc_status_to_py
Summary: sys-cluster/rdma-core-43.0 fails to compile (CYTHON3-SYSTEM): cq.c:20701:18: ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Cluster Team
URL:
Whiteboard: older versions only
Keywords: PATCH
: 913936 (view as bug list)
Depends on: 925743
Blocks: cython3-tracker
  Show dependency tree
 
Reported: 2023-03-02 08:29 UTC by Agostino Sarubbo
Modified: 2024-03-10 14:49 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,285.11 KB, text/plain)
2023-03-02 08:29 UTC, Agostino Sarubbo
Details
Bugfix (bugfix-898734.patch,1.33 KB, patch)
2023-09-10 14:45 UTC, Adrien Dessemond
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2023-03-02 08:29:36 UTC
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
Comment 1 Agostino Sarubbo gentoo-dev 2023-03-02 08:29:39 UTC
Created attachment 855584 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2023-03-02 08:29:40 UTC
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’
Comment 3 Larry the Git Cow gentoo-dev 2023-07-17 20:31:23 UTC
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(-)
Comment 4 Adrien Dessemond 2023-09-10 13:23:21 UTC
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) {
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-10 13:41:16 UTC
*** Bug 913936 has been marked as a duplicate of this bug. ***
Comment 6 Adrien Dessemond 2023-09-10 14:44:41 UTC
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.
Comment 7 Adrien Dessemond 2023-09-10 14:45:58 UTC
Created attachment 870263 [details, diff]
Bugfix
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-10 14:48:19 UTC
Why drop find_package? Is it still going to regenerate the Cython files?
Comment 9 Adrien Dessemond 2023-09-10 15:47:00 UTC
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.
Comment 10 Adrien Dessemond 2023-09-10 15:50:24 UTC
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).
Comment 11 Adrien Dessemond 2023-09-28 12:02:59 UTC
Issue still valid with sys-cluster/rdma-core-47.1
The very same patch solves it.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-10 06:46:52 UTC
(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?
Comment 13 Adrien Dessemond 2023-10-14 11:58:11 UTC
Me neither (yet), but yes I will certainly report this at upstream when I will have some time. Probably a bit later this weekend.
Comment 14 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-02-28 13:16:59 UTC
Ping.
Comment 16 Larry the Git Cow gentoo-dev 2024-02-29 08:02:23 UTC
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(+)
Comment 17 Larry the Git Cow gentoo-dev 2024-03-10 14:49:32 UTC
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(-)