Repository navigation
--disable-gil builds are not compatible with the limited API #111506
Copy link
Copy link
Closed as not planned
Labels
3.13only security fixesonly security fixestopic-C-APItopic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error3.13only security fixesonly security fixes
on Oct 30, 2023 cc @vstinner
Before creating a whole new ABI, I would like first to avoid
__asm__(...);inInclude/*.h, in the limited C API. Assembly code is not portable and can cause compilation issues.A first step for that is to implement Py_SET_REFCNT() as a function call: PR #111508.
These changes will require a PEP.
Please, could we have the PEP first, then do the changes?
- added a commit that references this issue
on Nov 3, 2023 Please, could we have the PEP first, then do the changes?
@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.
34 remaining items
- added a commit that references this issue
on Sep 18, 2025 - added 2 commits that reference this issue
on Oct 27, 2025 - added 4 commits that reference this issue
on Nov 18, 2025 - added a commit that references this issue
on Nov 19, 2025 - added a commit that references this issue
on Dec 4, 2025 - added a commit that references this issue
on Jan 6, 2026 Closing this in favor of #146636 which implements abi3t
Reacted by Clément Robert- added a commit that references this issue
on May 14, 2026 - added a commit that references this issue
on Sep 23, 2026
Metadata
Metadata
Assignees
Labels
3.13only security fixesonly security fixestopic-C-APItopic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Bug report
After #110764,
--disable-gilbuilds of CPython 3.13 are (temporarily) not be compatible with the limited API or the stable ABI due to modifications to thePyObjectheader. 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-gilbuilds 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+GetProcAddresson 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