Closed lazka closed 1 year ago
In theory you can build an abi3 extension via somthing like:
Extension( "spam", sources=["spam.c"], define_macros=[("Py_LIMITED_API", "0x03060000")], py_limited_api=True, )
setuptools itself does not contain any logic to link this to a different library though, nor does distutils, this is handled via pragma in cpython core: https://github.com/python/cpython/blob/47022a079eb9d2a2af781abae3de4a71f80247c2/PC/pyconfig.h#L313 which doesn't work outside of MSVC.
Which means with mingw-w64 we need to patch setuptools to extend distutils in case py_limited_api is passed and override get_libraries() https://github.com/pypa/distutils/blob/5a8ca1b0f362968a29f2fb9c107cc0d4d79c3263/distutils/command/build_ext.py#L735
fun....
This is now patched in https://github.com/msys2/MINGW-packages/pull/18232, as we can't really help with this in cpython directly I'm closing this.
In theory you can build an abi3 extension via somthing like:
setuptools itself does not contain any logic to link this to a different library though, nor does distutils, this is handled via pragma in cpython core: https://github.com/python/cpython/blob/47022a079eb9d2a2af781abae3de4a71f80247c2/PC/pyconfig.h#L313 which doesn't work outside of MSVC.
Which means with mingw-w64 we need to patch setuptools to extend distutils in case py_limited_api is passed and override get_libraries() https://github.com/pypa/distutils/blob/5a8ca1b0f362968a29f2fb9c107cc0d4d79c3263/distutils/command/build_ext.py#L735
fun....