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
--disable-gil
builds are not compatible with the limited API
#111506
Comments
cc @vstinner |
…ted C API In the limited C API version 3.13. Py_SET_REFCNT() is now implemented as an opaque function call. Add _Py_SetRefcnt() to the stable ABI.
…ted C API In the limited C API version 3.13, Py_SET_REFCNT() function is now implemented as an opaque function call. Add _Py_SetRefcnt() to the stable ABI.
Before creating a whole new ABI, I would like first to avoid A first step for that is to implement Py_SET_REFCNT() as a function call: PR #111508. |
…ted C API In the limited C API version 3.13, Py_SET_REFCNT() function is now implemented as an opaque function call. Add _Py_SetRefcnt() to the stable ABI.
These changes will require a PEP. Please, could we have the PEP first, then do the changes? |
…API (#111508) In the limited C API version 3.13, Py_SET_REFCNT() function is now implemented as an opaque function call. Add _Py_SetRefcnt() to the stable ABI.
In the limited C API version 3.13, the Py_REFCNT() function is now implemented as an opaque function call.
In the limited C API version 3.13, the Py_REFCNT() function is now implemented as an opaque function call.
@colesbury, do you still plan to write the PEP? Do you need any help? |
@encukou, yes I still intend to write the PEP. It just hasn't been as a high a priority as integrating the pieces of PEP 703. |
Add Objects/object_abi.c file and _Py_STABLE_ABI_IMPL macro.
Export Py_SET_REFCNT() opaque function as "Py_SET_REFCNT" symbol in the stable ABI. Add Objects/object_abi.c file and _Py_STABLE_ABI_IMPL macro.
Convert Py_SET_REFCNT() and _Py_IsImmortal() static inline functions to inline functions. Stable ABI now use "Py_SET_REFCNT" name instead of "_Py_SetRefcnt".
Convert Py_SET_REFCNT() and _Py_IsImmortal() static inline functions to inline functions. _Py_IsImmortal() has to be converted to an inline function, since non-static Py_SET_REFCNT() function cannot call a static _Py_IsImmortal() function. Py_SET_REFCNT() function is now exported as "Py_SET_REFCNT" name in the stable ABI, instead of "_Py_SetRefcnt".
Convert Py_SET_REFCNT() and _Py_IsImmortal() static inline functions to inline functions. Py_SET_REFCNT() function is now exported as "Py_SET_REFCNT" name in the stable ABI, instead of "_Py_SetRefcnt". _Py_IsImmortal() has to be converted to an inline function, since non-static Py_SET_REFCNT() function cannot call a static _Py_IsImmortal() function. _Py_IsImmortal() is not part of the stable ABI.
Convert Py_SET_REFCNT() and _Py_IsImmortal() static inline functions to inline functions. Py_SET_REFCNT() function is now exported as "Py_SET_REFCNT" name in the stable ABI, instead of "_Py_SetRefcnt". _Py_IsImmortal(), _Py_IsOwnedByCurrentThread() and _Py_ThreadId() have to be converted to an inline functions, since non-static Py_SET_REFCNT() function cannot call a static functions. _Py_IsImmortal(), _Py_IsOwnedByCurrentThread() and _Py_ThreadId() are not part of the stable ABI.
Convert Py_SET_REFCNT() and _Py_IsImmortal() static inline functions to inline functions. Py_SET_REFCNT() function is now exported as "Py_SET_REFCNT" name in the stable ABI, instead of "_Py_SetRefcnt". _Py_IsImmortal(), _Py_IsOwnedByCurrentThread() and _Py_ThreadId() have to be converted to an inline functions, since non-static Py_SET_REFCNT() function cannot call a static functions. _Py_IsImmortal(), _Py_IsOwnedByCurrentThread() and _Py_ThreadId() are not part of the stable ABI.
…ted C API (python#111508) In the limited C API version 3.13, Py_SET_REFCNT() function is now implemented as an opaque function call. Add _Py_SetRefcnt() to the stable ABI.
Issue a build time error if both `Py_LIMITED_API` and `Py_GIL_DISABLED` are defined.
…117762) Issue a build time error if both `Py_LIMITED_API` and `Py_GIL_DISABLED` are defined.
…ild (python#117762) Issue a build time error if both `Py_LIMITED_API` and `Py_GIL_DISABLED` are defined.
Bug report
After #110764,
--disable-gil
builds of CPython 3.13 are (temporarily) not be compatible with the limited API or the stable ABI due to modifications to thePyObject
header. For context, this was noted in the "Backwards Compatibility" section of PEP 703.Based on feedback on the related discuss post and discussions with Gregory Smith, Guido, Petr, and Victor at the core dev sprint, I believe we can make changes to the stable ABI so that extension author can target a single stable ABI that supports CPython 3.7+ and both the default build and the
--disable-gil
builds of CPython 3.13+.These changes will require a PEP. This issue is intended just to keep track of the known problem.
The rough idea is:
Py_SIZE
,Py_TYPE
,Py_SET_REFCNT
,Py_REFCNT
) "real" function calls in the stable ABI for CPython 3.13+GetProcAddress
on Windows) or weak symbols (on Linux/macOS) to determine at runtime if the active CPython version provides the desired functions. Otherwise, fall back to old definitions of the above functions for CPython <= 3.12.Linked PRs
The text was updated successfully, but these errors were encountered: