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-140550: Enable limited C API tests on Free Threading in test_cext by vstinner · Pull Request #157493 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Sep 14, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Enable limited C API tests on Free Threading in test_cext and test_cppext: test Py_TARGET_ABI3T macro.

  • Convert test_cppext to PySlot API using PySlot_PTR_STATIC().
  • Define Py_MOD_GIL_NOT_USED in test_cext and test_cppext.
  • Disable C++ test_virtual_object() if Py_TARGET_ABI3T is defined.
  • Remove ";" from PyABIInfo_VAR macro definition, since "PyABIInfo_VAR(abi_info);" added two ";;" which is illegal in C++03.
  • Issue: Implement PEP 793 – PyModExport #140550

Sorry, something went wrong.

Uh oh!

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

All reactions
@vstinner
pythongh-140550: Enable limited C API tests on Free Threading in test…
9bed8d3
…_cext

Enable limited C API tests on Free Threading in test_cext and
test_cppext: test Py_TARGET_ABI3T macro.

* Convert test_cppext to PySlot API using PySlot_PTR_STATIC().
* Define Py_MOD_GIL_NOT_USED in test_cext and test_cppext.
* Disable C++ test_virtual_object() if Py_TARGET_ABI3T is defined.
* Remove ";" from PyABIInfo_VAR macro definition, since
  "PyABIInfo_VAR(abi_info);" added two ";;" which is illegal in
  C++03.
@vstinner
vstinner requested a review from ericsnowcurrently as a code owner September 14, 2026 13:31
@bedevere-app bedevere-app Bot mentioned this pull request Sep 14, 2026
Implement PEP 793 – PyModExport #140550
Open
19 of 25 tasks
@bedevere-app bedevere-app Bot added the awaiting core review label Sep 14, 2026
@vstinner

vstinner commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

cc @encukou

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner vstinner mentioned this pull request Sep 14, 2026
[3.15] gh-140550: Fix PyABIInfo_VAR macro: avoid ";" #157494
Merged
@vstinner vstinner added the needs backport to 3.15 bugs and security fixes label Sep 14, 2026
@vstinner

vstinner commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

!buildbot

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner vstinner added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 14, 2026
@bedevere-bot

bedevere-bot commented Sep 14, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @vstinner for commit 9bed8d3 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F157493%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 Sep 14, 2026
@vstinner

vstinner commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

test_limited_cpp03ext() of test_cppext failed on ARM64 macOS:

  /usr/bin/clang++ -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-strict-overflow -Wsign-compare -g -Og -Wall -I/Users/buildbot/buildarea/pull_request.pablogsal-macos-m1.macos-with-brew/build/build/test_python_61414æ/tempcwd/env/include -I/Users/buildbot/buildarea/pull_request.pablogsal-macos-m1.macos-with-brew/build/Include -I/Users/buildbot/buildarea/pull_request.pablogsal-macos-m1.macos-with-brew/build -c extension.cpp -o build/temp.macosx-26.6-arm64-cpython-316-pydebug/extension.o -Werror -DMODULE_NAME=_test_limited_cpp03ext -std=c++03 -pedantic-errors -Wno-long-long -DPy_LIMITED_API=0x31000a0
  extension.cpp:332:36: error: cast between pointer-to-function and pointer-to-object is an extension [-Werror,-Wpedantic]
    332 |     PySlot_PTR_STATIC(Py_mod_exec, (void*)_testcppext_exec),
        |                                    ^~~~~~~~~~~~~~~~~~~~~~~
  /Users/buildbot/buildarea/pull_request.pablogsal-macos-m1.macos-with-brew/build/Include/slots.h:54:59: note: expanded from macro 'PySlot_PTR_STATIC'
     54 |     {(NAME), PySlot_INTPTR | PySlot_STATIC, {0}, {(void*)(VALUE)}}
        |                                                           ^~~~~

test.pythoninfo logs CC.version: Apple clang version 21.0.0 (clang-2100.1.1.101), so I guess that it's clang++ 21.0.0. test.pythoninfo should also lox CXX.version.

I supposed that we should disable -Wpedantic on PySlot defintions, as do already on the PyModuleDef_Slot definitions.

All reactions

Sorry, something went wrong.

Uh oh!

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

@encukou

encukou commented Sep 14, 2026

Copy link
Copy Markdown
Member

I supposed that we should disable -Wpedantic on PySlot defintions

Only on PySlot_PTR & PySlot_PTR_STATIC (that is, the shims added for compatibility with C++11, but trade off pedantic type safety -- exactly as the test found out).

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

@vstinner

vstinner commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

x86-64 MacOS Intel NoGIL PR failed the same way: test_limited_cpp03ext() of test_cppext failed with:

  /usr/bin/clang++ -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-strict-overflow -Wsign-compare -g -Og -Wall -I/Users/buildbot/buildarea/pull_request.itamaro-macos-intel-aws.nogil/build/build/test_python_58460æ/tempcwd/env/include -I/Users/buildbot/buildarea/pull_request.itamaro-macos-intel-aws.nogil/build/Include -I/Users/buildbot/buildarea/pull_request.itamaro-macos-intel-aws.nogil/build -c extension.cpp -o build/temp.macosx-13.7-x86_64-cpython-316t-pydebug/extension.o -Werror -DMODULE_NAME=_test_limited_cpp03ext -std=c++03 -pedantic-errors -Wno-long-long -DPy_LIMITED_API=0x31000a0
  extension.cpp:332:36: error: cast between pointer-to-function and pointer-to-object is an extension [-Werror,-Wpedantic]
      PySlot_PTR_STATIC(Py_mod_exec, (void*)_testcppext_exec),
                                     ^~~~~~~~~~~~~~~~~~~~~~~
  /Users/buildbot/buildarea/pull_request.itamaro-macos-intel-aws.nogil/build/Include/slots.h:54:59: note: expanded from macro 'PySlot_PTR_STATIC'
      {(NAME), PySlot_INTPTR | PySlot_STATIC, {0}, {(void*)(VALUE)}}
                                                            ^~~~~

test_cppext uses clang++. test.pythoninfo says CC.version: Apple clang version 15.0.0 (clang-1500.1.0.2.5).

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner
Ignore pedantic warnings on PySlot
5b05582
@vstinner

vstinner commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

!buildbot ARM64 macOS PR

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Sep 14, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @vstinner for commit 5b05582 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F157493%2Fmerge

The command will test the builders whose names match following regular expression: ARM64 macOS PR

The builders matched are:

  • ARM64 macOS PR
All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

!buildbot x86-64 MacOS Intel NoGIL PR

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Sep 14, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @vstinner for commit 5b05582 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F157493%2Fmerge

The command will test the builders whose names match following regular expression: x86-64 MacOS Intel NoGIL PR

The builders matched are:

  • x86-64 MacOS Intel NoGIL PR
All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

I pushed a fix for the warning on "cast between pointer-to-function and pointer-to-object is an extension" in pedantic mode.

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

!buildbot x86-64 MacOS Intel NoGIL PR

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Sep 14, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @vstinner for commit 5b05582 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F157493%2Fmerge

The command will test the builders whose names match following regular expression: x86-64 MacOS Intel NoGIL PR

The builders matched are:

  • x86-64 MacOS Intel NoGIL PR
All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

Good, the test suite passed on "buildbot/ARM64 macOS PR" and "buildbot/x86-64 MacOS Intel NoGIL PR".

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

I will wait until #157539 is merged, and then merge this change on top of it.

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

@vstinner
Merge branch 'main' into test_cext_abi3t
11e0fa1
@vstinner
vstinner enabled auto-merge (squash) September 15, 2026 14:46
@vstinner
vstinner merged commit fb123c8 into python:main Sep 15, 2026
54 checks passed

Uh oh!

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

@vstinner
vstinner deleted the test_cext_abi3t branch September 15, 2026 15:17
@miss-islington-app

miss-islington-app Bot commented Sep 15, 2026

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting core review label Sep 15, 2026
@bedevere-app

bedevere-app Bot commented Sep 15, 2026

Copy link
Copy Markdown

GH-157560 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Sep 15, 2026
serhiy-storchaka pushed a commit that referenced this pull request Oct 10, 2026
@miss-islington @vstinner
[3.15] gh-140550: Enable limited C API tests on Free Threading in tes…
96f7177
…t_cext (GH-157493) (GH-157560)

Enable limited C API tests on Free Threading in test_cext and
test_cppext: test Py_TARGET_ABI3T macro.

* Convert test_cppext to PySlot API using PySlot_PTR_STATIC().
* Define Py_MOD_GIL_NOT_USED in test_cext and test_cppext.
* Disable C++ test_virtual_object() if Py_TARGET_ABI3T is defined.
(cherry picked from commit fb123c8)

Co-authored-by: Victor Stinner <[email protected]>
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

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

3 participants

@vstinner @bedevere-bot @encukou
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.