10000 [BUG] Py_GIL_DISABLED not defined in "free-threaded" Windows C-API extensions · Issue #4662 · pypa/setuptools · GitHub
[go: up one dir, main page]

Skip to content
[BUG] Py_GIL_DISABLED not defined in "free-threaded" Windows C-API extensions #4662
@cvijdea-bd

Description

@cvijdea-bd

setuptools version

75.1.0

Python version

3.13

OS

Windows

Additional environment information

No response

Description

When building a native extension against the free-threading build, the Py_GIL_DISABLED macro is not defined, which on Windows causes the built extension to crash on import due to linking to python313.dll instead of python313t.dll.

python/cpython#111650 seems to imply that it should be setuptools' job to handle this.

Expected behavior

Py_GIL_DISABLED macro is defined when building if sysconfig.get_config_var("Py_GIL_DISABLED").

How to Reproduce

py -3.13t -m pip install git+https://github.com/giampaolo/psutil.git@b1e52fcfe4bd0a3d09334fddd6ffd23288f77a79
py -3.13t -c "import psutil"


### Output

segfault in python313.dll

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0