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: Remove PyInit function from test_cext by encukou · Pull Request #141511 · python/cpython

Conversation

@encukou

@encukou encukou commented Nov 13, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This should not be necessary, but let me ask the buildbots.

  • Issue: Implement PEP 793 – PyModExport #140550

Sorry, something went wrong.

Uh oh!

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

All reactions
@encukou
pythongh-140550: Removp PyInit function from test_cext
1ad68bf
@bedevere-app bedevere-app Bot added the awaiting core review label Nov 13, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Nov 13, 2025
Implement PEP 793 – PyModExport #140550
Open
19 of 25 tasks
@encukou encukou added the skip news label Nov 13, 2025
vstinner
vstinner approved these changes Nov 13, 2025
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Nov 13, 2025
@encukou encukou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 14, 2025
@bedevere-bot

bedevere-bot commented Nov 14, 2025

Copy link
Copy Markdown

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

Results will be shown at:

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

vstinner commented Nov 14, 2025

Copy link
Copy Markdown
Member

FreeBSD failures are unrelated and should be fixed by #141551.

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Nov 14, 2025

Copy link
Copy Markdown
Member

buildbot/AMD64 Windows PGO NoGIL PR
buildbot/AMD64 Windows11 Non-Debug PR

test_cext fails with:

  "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\Administrator\buildarea\pull_request.itamaro-win64-srv-22-aws.nogil.pgo\build\PCbuild\AMD64 /LIBPATH:C:\Users\Administrator\buildarea\pull_request.itamaro-win64-srv-22-aws.nogil.pgo\build\build\test_python_3776æ\tempcwd\env\libs /LIBPATH:C:\Users\Administrator\buildarea\pull_request.itamaro-win64-srv-22-aws.nogil.pgo\build\libs /LIBPATH:C:\Users\Administrator\buildarea\pull_request.itamaro-win64-srv-22-aws.nogil.pgo\build /LIBPATH:C:\Users\Administrator\buildarea\pull_request.itamaro-win64-srv-22-aws.nogil.pgo\build\build\test_python_3776æ\tempcwd\env\PCbuild\amd64 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.26100.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.26100.0\\um\x64" /EXPORT:PyInit__test_cext build\temp.win-amd64-cpython-315t\Release\extension.obj /OUT:build\lib.win-amd64-cpython-315t\_test_cext.cp315t-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-315t\Release\_test_cext.cp315t-win_amd64.lib
  LINK : error LNK2001: unresolved external symbol PyInit__test_cext
  build\temp.win-amd64-cpython-315t\Release\_test_cext.cp315t-win_amd64.lib : fatal error LNK1120: 1 unresolved externals
  error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
  error: subprocess-exited-with-error

It looks like a legit error.

The (long) build command contains /EXPORT:PyInit__test_cext.

All reactions

Sorry, something went wrong.

Uh oh!

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

@encukou

encukou commented Nov 14, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

This one will need coordination with setuptools. Glad we found it early :)

Setuptools is adding an /EXPORT specification to the LINK command for the PyInit_* function.
This fails if there is no such function.

According to MSVC docs:

There are four methods for exporting a definition, listed in recommended order of use:

  1. __declspec(dllexport) in the source code
  2. An EXPORTS statement in a .def file
  3. An /EXPORT specification in a LINK command
  4. A comment directive in the source code, of the form #pragma comment(linker, "/export: definition ").

We should be using method (1). Once we do, setuptools can stop doing (3), perhaps conditionally.

All reactions

Sorry, something went wrong.

Uh oh!

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

@encukou
encukou marked this pull request as draft November 14, 2025 15:59
@bedevere-app bedevere-app Bot removed the awaiting merge label Nov 14, 2025
@encukou

encukou commented Jan 13, 2026

Copy link
Copy Markdown
Member Author

setuptools/distutils PR: pypa/distutils#395

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

skip news stale Stale PR or inactive for long period of time.

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

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