Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While looking at #333, I hypothesized that upgrading Cython might solve the issue. It didn't. But upgrading should still happen at some point. This is my work in progress on that. The tests pass, but there are two main things missing:
Problem (1):
Starting with Cython 3, you can only do
except+
orexcept +reraise_kj_exception
onextern
functions coming from C++. (This makes sense, and the way things were declared in Pycapnp wasn't too good.) As a result, I had to remove a lot of these declarations. This results in some segmentation faults, because Cython no longer detects C++ exceptions and converts them to Python exceptions in some places.To solve this, all
extern
declarations in.pxd
files have to be examined andexcept +reraise_kj_exception
clauses need to be added to anything that might throw. Previously, this was done really inconsistently. The lazy solution would be to just add the clause everywhere, but I'm not sure what the performance implications are.Problem (2):
The compilation output of
python setup.py build_ext --inplace
is now full of messages like these:There are to many
move
calls inserted. I'm not sure if this is a Cython issue, or if we are somehow annotating things wrong. Might be worth asking the Cython people.I'm not planning on working on this further in the short term. If someone wants to take over on this, feel free.