-
-
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
Fix compilation with CPython 3.12a6 #5339
Conversation
CPython 3.12a6 made PyThreadState an opaque structure thus the fast thread state optimization cannot be employed anymore. Fixes cython#5286.
That's what we did in 0.29.x. However, for 3.0, I'd rather have a more efficient solution. |
That said, we can still disable it until we have a better solution. That unblocks users who want to test with Py3.12. |
Thanks |
Thanks @scoder I haven't recently tried the 0.29.x branch tip, but till recently 0.29 did not work on CPython 3.12: some fixes present only on master were necessary. Now I see that the equivalent of this fix was applied to the 0.29.x branch over a year ago bbac8b5. It seems that the CPython compatibility state of the two branches diverged a bit over time. I would be happy to work on the better solution, but I'm not sure about what kind of dirty tricks is allowed to play in Cython to get access to the CPython internals. I can have a look at this if you point me to some "prior art" in this domain. |
One more thing: it seems that CI was passing on CPython 3.12a6 without this patch. Do the tests need to be tightened up somehow to catch this kind of issues? Without this patch the compilation of very simple code fails for me. |
3.12 is deliberately set as an allowed failure until it's released (so looks like it passed). The tests will almost certainly not be passing if you look in more details. We expect it to get broken multiple times before release and don't really want that to block things like the recent Cython beta release |
In the sense that 0.29.x is the legacy, boring, conservative branch where we avoid changes if possible and prefer disabling optimisations over risking breakage of existing code or requiring new releases all the time. 3.0 has a different goal where we try to improve the performance and adapt to changes in CPython. |
CPython 3.12a6 made PyThreadState an opaque structure thus the fast thread state optimization cannot be employed anymore.
Fixes #5286.