Skip to content

Handle free-threaded builds in build_ext.get_libraries#389

Merged
jaraco merged 3 commits into
pypa:mainfrom
mwilliamson:python314t-mingw32
Jul 10, 2026
Merged

Handle free-threaded builds in build_ext.get_libraries#389
jaraco merged 3 commits into
pypa:mainfrom
mwilliamson:python314t-mingw32

Conversation

@mwilliamson

Copy link
Copy Markdown
Contributor

This updates build_ext.get_libraries to handle free-threaded builds of Python when using non-MSVC compilers.

Previously, the non-free-threaded library would be used for free-threaded builds of Python. For instance, when attempting to build an extension for python314t, the extension would be linked against python314.

This fixes pypa/setuptools#5126.

I've manually tested this by using a similarly patched setuptools to successfully build jq.py wheels using mingw32 on Windows for python314t. While there are some automated tests for build_ext, my impression from a quick look was that those tests rely on being run in the relevant environment, rather than (for instance) mocking the environment, and therefore updating the tests to check this case isn't straightforward.

mwilliamson and others added 3 commits December 19, 2025 12:21
This updates build_ext.get_libraries to handle free-threaded builds
of Python when using non-MSVC compilers.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jaraco

jaraco commented Jul 10, 2026

Copy link
Copy Markdown
Member

I don't understand the diffcov error:

distutils/command/build_ext.py (50.0%): Missing lines 787

Doesn't matter for this small change.

@jaraco
jaraco merged commit 4b078db into pypa:main Jul 10, 2026
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Fail to compile extensions on Windows free-threading non-MSVC

2 participants