Skip to content

Conversation

@colesbury
Copy link
Contributor

@colesbury colesbury commented Apr 11, 2024

Issue a build time error if both Py_LIMITED_API and Py_GIL_DISABLED are defined.

Without this, extensions may compile (with warnings), but crash on import.

Issue a build time error if both `Py_LIMITED_API` and `Py_GIL_DISABLED` are defined.
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

#endif

#if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED)
# error "The limited API is not currently supported in the free-threaded build"
Copy link
Member

@vstinner vstinner Apr 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible maybe to add a link for more information? Or issue number?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a reference to the GH issue. We might want to consider adding a link to a HOWTO once we have more docs for the free-threaded build.

@colesbury colesbury merged commit 39d381f into python:main Apr 11, 2024
@colesbury colesbury deleted the gh-111506-build-error branch April 11, 2024 17:49
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…ild (python#117762) Issue a build time error if both `Py_LIMITED_API` and `Py_GIL_DISABLED` are defined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment