GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-146636: abi3t: Define Py_GIL_DISABLED but do not to use it by encukou · Pull Request #148142 · python/cpython

Conversation

@encukou

@encukou encukou commented Apr 5, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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, since abi3 and abi3t ought to be the same except the _Py_OPAQUE_PYOBJECT differences.
This is done using the GCC-only poison pragma, which tells the compiler/preprocessor to error if it ever sees the identifier after the pragma.
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 a cpython/ header, as they're rather self-contained.

  • Issue: Implement PEP 803 -- abi3t #146636

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@encukou
pythongh-146636: abi3t: Define Py_GIL_DISABLED but make sure not to u…
cb3c6fe
…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.
@encukou
encukou requested a review from ericsnowcurrently as a code owner April 5, 2026 21:38
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 5, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Apr 5, 2026
Implement PEP 803 -- abi3t #146636
Closed
8 of 9 tasks
@encukou
encukou marked this pull request as draft April 5, 2026 21:38
@bedevere-app bedevere-app Bot removed the awaiting core review label Apr 5, 2026
@encukou encukou added the skip news label Apr 5, 2026
@encukou
encukou marked this pull request as ready for review April 6, 2026 08:55
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 6, 2026
@encukou encukou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 6, 2026
@bedevere-bot

bedevere-bot commented Apr 6, 2026

Copy link
Copy Markdown

🤖 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 6, 2026
@encukou
Revert the poisoning for now
1cd72a7
@encukou encukou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 7, 2026
@bedevere-bot

bedevere-bot commented Apr 7, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @encukou for commit 1cd72a7 🤖

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 7, 2026
@encukou encukou changed the title gh-146636: abi3t: Define Py_GIL_DISABLED but make sure not to use it gh-146636: abi3t: Define Py_GIL_DISABLED but do not to use it Apr 7, 2026
@encukou encukou added the release-blocker label Apr 7, 2026
@github-project-automation github-project-automation Bot added this to Release and Deferred blockers 🚫 Apr 7, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Release and Deferred blockers 🚫 Apr 7, 2026
@encukou

encukou commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

Some paths still use Py_GIL_DISABLED.
I'd like to merge this for today's alpha without the check; I'll add the check later.

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou
encukou merged commit fbc1a5b into python:main Apr 7, 2026
77 of 86 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-project-automation github-project-automation Bot moved this from Todo to Done in Release and Deferred blockers 🚫 Apr 7, 2026
@encukou
encukou deleted the abi3t-pygildisabled branch April 7, 2026 07:06
@bedevere-app bedevere-app Bot removed the awaiting core review label Apr 7, 2026
@bedevere-bot

bedevere-bot commented Apr 7, 2026

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Windows PGO Tailcall 3.x (tier-1) has failed when building commit fbc1a5b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1870/builds/329) and take a look at the build logs.
  4. Check if the failure is related to this commit (fbc1a5b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1870/builds/329

Summary of the results of the build (if available):

Click to see traceback logs
remote: Enumerating objects: 13, done.        
remote: Counting objects:  14% (1/7)        
remote: Counting objects:  28% (2/7)        
remote: Counting objects:  42% (3/7)        
remote: Counting objects:  57% (4/7)        
remote: Counting objects:  71% (5/7)        
remote: Counting objects:  85% (6/7)        
remote: Counting objects: 100% (7/7)        
remote: Counting objects: 100% (7/7), done.        
remote: Compressing objects:  16% (1/6)        
remote: Compressing objects:  33% (2/6)        
remote: Compressing objects:  50% (3/6)        
remote: Compressing objects:  66% (4/6)        
remote: Compressing objects:  83% (5/6)        
remote: Compressing objects: 100% (6/6)        
remote: Compressing objects: 100% (6/6), done.        
remote: Total 13 (delta 1), reused 4 (delta 1), pack-reused 6 (from 3)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to 'fbc1a5b0761f4331c7070201fefd5b5deb75ebdd'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at fbc1a5b0761 gh-146636: abi3t: Define Py_GIL_DISABLED but do not use it (GH-148142)
Switched to and reset branch 'main'

Could Not Find C:\bbarea\3.x.itamaro-win64-srv-22-aws.tailcall.pgo\build\PCbuild\*.pgc
Could Not Find C:\bbarea\3.x.itamaro-win64-srv-22-aws.tailcall.pgo\build\Lib\*.pyc
Could Not Find C:\bbarea\3.x.itamaro-win64-srv-22-aws.tailcall.pgo\build\PCbuild\*.pgc
Could Not Find C:\bbarea\3.x.itamaro-win64-srv-22-aws.tailcall.pgo\build\Lib\*.pyc
Could Not Find C:\bbarea\3.x.itamaro-win64-srv-22-aws.tailcall.pgo\build\Lib\*.pyc
The system cannot find the file specified.
Could Not Find C:\bbarea\3.x.itamaro-win64-srv-22-aws.tailcall.pgo\build\PCbuild\python*.zip

Could Not Find C:\bbarea\3.x.itamaro-win64-srv-22-aws.tailcall.pgo\build\Lib\*.pyc
The system cannot find the file specified.
Could Not Find C:\bbarea\3.x.itamaro-win64-srv-22-aws.tailcall.pgo\build\PCbuild\python*.zip
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou encukou mentioned this pull request Apr 9, 2026
gh-146636: Improve ABI/feature selection, add new header for it #148302
Merged
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@encukou @ljfp
pythongh-146636: abi3t: Define Py_GIL_DISABLED but do not use it (pyt…
3717be2
…honGH-148142)

When compiling for abi3t, define Py_GIL_DISABLED, so that users who
check it to enable additional locking aren't broken.

But also avoid using Py_GIL_DISABLED in Python headers themselves
-- abi3 and abi3t ought to be the same except
the _Py_OPAQUE_PYOBJECT differences.

A check for this is coming in a later PR.
It will require rewriting some preprocessor conditions, some of these
changes are included in this PR.
For _Py_IsOwnedByCurrentThread & supporting functions
I opted to move them to a cpython/ header, as they're rather self-contained.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

release-blocker skip news

Projects

Release and Deferred blockers 🚫
Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@encukou @bedevere-bot
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.