gh-146636: abi3t: Define Py_GIL_DISABLED but make sure not to use it#148142
Open
encukou wants to merge 1 commit intopython:mainfrom
Open
gh-146636: abi3t: Define Py_GIL_DISABLED but make sure not to use it#148142encukou wants to merge 1 commit intopython:mainfrom
encukou wants to merge 1 commit intopython:mainfrom
Conversation
…se it When compiling for abi3t, define Py_GIL_DISABLED, so that users who check it to enable additional locking aren't broken. But also add a test that Python headers themselves don't use Py_GIL_DISABLED -- abi3 and abi3t ought to be the same except the _Py_OPAQUE_PYOBJECT differences. This is done using the GCC-only poison pragma. This did require rewriting some preprocessor conditions, and moving _Py_IsOwnedByCurrentThread & supporting functions to a cpython/ header.
8 tasks
|
🤖 New build scheduled with the buildbot fleet by @encukou for commit cb3c6fe 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F148142%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When compiling for abi3t, define
Py_GIL_DISABLED, so that users who check it to enable additional locking aren't broken.But also add a test that Python headers themselves don't use
Py_GIL_DISABLED, sinceabi3andabi3tought to be the same except the_Py_OPAQUE_PYOBJECTdifferences.This is done using the GCC-only
poisonpragma, which tells the compiler/preprocessor to error if it ever sees the identifier after thepragma.This did require rewriting some preprocessor conditions --
#if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED)needs to be split into two lines, as the poisoning doesn't honour short-circuiting.For
_Py_IsOwnedByCurrentThread& supporting functions I opted to move them to acpython/header, as they're rather self-contained.