Skip to content

Supporting 3.15.0b1 and finishing off support for the 3.15 ABI #6012

@ngoldbaum

Description

@ngoldbaum

See also #5786, which is related and probably is fixed at the same time or nearly the same time.

There have been some late-breaking PEP acceptances that will break our current experimental support for Python 3.15 based on the ABIs in the alpha releases. In particular, PEP 820 changes how the PEP 793 PyModExport API works. The implementation hasn't been merged into CPython yet but is supposed to be in CPython 3.15.0b1 due out next week.

See python/cpython#149055 for the upstream implementation and https://peps.python.org/pep-0820/ for details.

In addition to that, there is another minor ABI change we haven't yet accounted for: I ran the ffi-check tests and I also see an unrelated change in the layout of PyTypeObject (fallout from python/cpython#145668).

I built a version of CPython based on the upstream PEP 820 PR and see a test failure in the module initialization test:

failures:

---- impl_::pymodule::tests::module_init stdout ----

thread 'impl_::pymodule::tests::module_init' (21304405) panicked at src/impl_/pymodule.rs:464:53:
called `Result::unwrap()` on an `Err` value: PyErr { type: <class 'SystemError'>, value: SystemError('invalid module slot 5 (Py_mp_subscript)'), traceback: None }


failures:
    impl_::pymodule::tests::module_init

As explicitly noted in PEP 820, we are going to need to update our PEP 793 PyModExport implementation (see #5746 and #5753) to use the new PySlot API.

Additionally, the steering council decided that the critical section API will also be included in the limited API starting in Python 3.15. See python/cpython#149225 for more details on that.

I don't see any other ABI changes we haven't already accounted for in 3.15. That said, there might also be other last-minute changes. ABI breaks always tend to sneak in right before the freeze.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions