Skip to content
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

pycapnp v2.0.0 incompatible with Cython 3.0+ #377

Open
Dillon-McCardell opened this issue Mar 20, 2025 · 0 comments
Open

pycapnp v2.0.0 incompatible with Cython 3.0+ #377

Dillon-McCardell opened this issue Mar 20, 2025 · 0 comments

Comments

@Dillon-McCardell
Copy link

When building pycapnp 2.0.0 with Cython 3.0, multiple compilation errors occur due to stricter C++ exception handling requirements in the newer Cython version. The errors indicate that only extern functions can throw C++ exceptions.

Example error:

Error compiling Cython file:
capnp/lib/capnp.pyx:1032:10: Only extern functions can throw C++ exceptions.

This occurs in multiple functions throughout capnp/lib/capnp.pyx that use the except +reraise_kj_exception syntax but aren't marked as extern. Some affected functions include:

  • _get(self, field)
  • to_bytes(_DynamicStructBuilder self)
  • to_segments(_DynamicStructBuilder self)
  • _to_bytes_packed_helper(_DynamicStructBuilder self, word_count)

To maintain compatibility with Cython 3.0+, these functions need to be marked as extern or the exception handling approach needs to be modified. Currently, the only workaround is to pin to an older version of Cython (pre-3.0), which isn't ideal for long-term maintenance.

Environment:

  • pycapnp version: 2.0.0
  • Cython version: 3.0.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant