-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] migration to cython3.0.5: redefinition of '__Pyx_Enum_<enum_name>_to_py #5860
Comments
That's almost certainly a bug rather than something that should be in the migration notes. |
My suspicion (based on a quick look through the code) is that this is to do with duplicating enums via both If that's the case it may be difficult for Cython to deal with - it'd be better to raise an error earlier rather than generating invalid C code though. |
@da-woods Firstly, thanks for your quick response! But this behavior was protected and worked for years, up until cython3. |
BTW, I tried to prevent that by removing the direct enums cimports and cimport from teh files that already includes them. cimport pyverbs.libibverbs_enums as e
cimport pyverbs.libibverbs as v
#then: v.<some_struct>; e.<some_enum> I did:
The compilation succeeds, but I get a lot of UserWarnings in runtime, such as:
While every enum.pxd file has a corresponding enum.pyx file (usually as a symlink) |
@da-woods Could you please take a look at this issue? |
Fix conflicting names of cpdef enum to_py functions when the an enum with the name name exists in multiple modules. Instead use the cname to name the to_py function since we have already ensured that it is unique and mangled with the module name. Possibly fixes cython#5860 (it definitely fixes a real bug, but that project has far too many dependencies for me to test, so who knows if it fixes *that* bug).
A |
Fix conflicting names of cpdef enum to_py functions when the an enum with the name name exists in multiple modules. Instead use the cname to name the to_py function since we have already ensured that it is unique and mangled with the module name. Possibly fixes #5860 (it definitely fixes a real bug, but that project has far too many dependencies for me to test, so who knows if it fixes *that* bug).
Re-opening this because it probably wasn't fixed by #5887. Don't think I'll be able to track down the issue though |
Actually, possibly might - I missed the bit about |
It's quite easy to reproduce it, no need to install dependencies manually, rdma-core provides a tool that compiles it on a containerized environment . After checking out to this branch you can run: |
I already tried that but had enums exposure issues in python runtime. |
update cython3.0.8 not help build rdma-core :-( |
Closed in 0185350 |
Describe the bug
I'm having an issue with migrating PyVerbs package, part of the upstream rdma-core, to cython3.
We've been working for a few years with Cython 0.2X.YY versions without the below issues.
And I didn't find a solved issue for this or any relevant notes in the migration document.
Code to reproduce the behaviour:
Go to rdma-core project and checkout this PR branch:Update to fc39
Then, to build, and reproduce, you can do:
Expected behaviour
I expect the compilation to pass as it's been passing on any Cython 0.29.XY versions.
The cythonization process creates a duplicate enum definition in the C files due to the "inlucde <pxd_file_name>.pxd" lines.
OS
Linux
Python version
3.10.8
Cython version
3.0.5 (actually from any cython3 version)
Additional context
No response
The text was updated successfully, but these errors were encountered: