Uh oh!
There was an error while loading. Please reload this page.
add PyO3 FFI checks to the suite - #55
Conversation
mattip
commented
Aug 29, 2026
I opened PyO3/pyo3#6345 about the c_int failures. The missing _PyInterpreterFrame is typedefed in frameobject.h, i wonder why it was not found |
davidhewitt
commented
Aug 29, 2026
I opened PyO3/pyo3#6374 which should address both issues, once merged we'll see what the next issues are 👀 |
davidhewitt
commented
Sep 1, 2026
Ok we're now at a point where we see the wstr fields removed in PEP 623, I guess that's an action on PyPy. Plus I think CPython changed the PyObject struct to have a union for one field, PyPy might not care about that in which case we can action that on the PyO3 side. |
mattip
commented
Sep 1, 2026
I am working on the wstr change, thanks for pointing it out. Then I will think about the union. We need to be able to parse the struct with pycparser, I don't know if it will handle that and if not how we can have an internal/external declaration. I would like to move to 100% CPython compatibility for the limited API functions and structs. |
bschoenmaeckers
commented
Sep 1, 2026
This is cool, as RustPython is also aiming to support CPython abi3t! |
davidhewitt
commented
Sep 2, 2026
This would be nice, you should definitely check out 3.15's abi3t which removes the layout of the PyObject struct from the ABI. I wonder if abi3t would allow PyPy to do more of the optimizations which e.g. HPy also makes possible. (I realise that PyPy probably has a fair bit of work to catch up with 3.15, however...) |
bschoenmaeckers
commented
Sep 2, 2026
I'm wondering if it's possible to backport abi3t to previous versions. But this probably lacks essential functions |
mattip
commented
Sep 3, 2026
I refactored to remove the wstr field, thanks for pointing out 3.12 removed it. As for the anonymous structure, that is a deeper problem with the PyPy RPython infrastructure. We need to be able to parse the struct definition with internal tools, they cannot handle a union. Is there a way to simplify that from the PyO3 side? |
mattip
commented
Sep 3, 2026
closing/reopening to retrigger CI |
mattip
commented
Sep 3, 2026
I also merged the PR to not mangle names of all the limited-api functions. This will undoubtedly mess up the PyO3 special-casing of function names. |
davidhewitt
commented
Sep 6, 2026
PyO3/pyo3#6389 will hopefully catch up PyO3 to the next phase of changes here. |
I added
nox -s ffi-checkjob from PyO3 which runs some sanity checks that PyO3's FFI definitions match what PyPy is exporting from its headers.NB from running this locally I think I observed that PyPy needs to implement PEP 623.