Skip to content
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

gh-111506: Error if the limited API is used in free-threaded build #117762

Merged
merged 2 commits into from Apr 11, 2024

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

@@ -45,6 +45,9 @@
# endif
#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
34 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants