From dc06507f2e1f044f610ae141f51de2bd0c281e48 Mon Sep 17 00:00:00 2001 From: Sergei Iakhnitskii Date: Sat, 26 Sep 2026 12:31:44 +0300 Subject: [PATCH] win: ship python3t.dll and python3t.lib in GIL-enabled builds Extensions built for both abi3 and abi3t (PEP 803) link python3t.dll, which the GIL-enabled package did not ship, so they failed to import. The build already produces it as a forwarder to python3XY.dll. Fixes #934 --- recipe/build_base.bat | 5 ++++- recipe/meta.yaml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/recipe/build_base.bat b/recipe/build_base.bat index 028de2629..2b3318dd3 100644 --- a/recipe/build_base.bat +++ b/recipe/build_base.bat @@ -110,7 +110,8 @@ if errorlevel 1 exit 1 cd .. :: Populate the root package directory -for %%x in (python%VERNODOTS%%THREAD%%_D%.dll python3%THREAD%%_D%.dll python%EXE_T%%_D%.exe pythonw%EXE_T%%_D%.exe) do ( +:: GIL builds need python3t.dll too, for abi3t extensions (PEP 803) +for %%x in (python%VERNODOTS%%THREAD%%_D%.dll python3%THREAD%%_D%.dll python3t%_D%.dll python%EXE_T%%_D%.exe pythonw%EXE_T%%_D%.exe) do ( if exist %SRC_DIR%\PCbuild\%HOST_DIR%\%%x ( copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\%%x %PREFIX% ) else ( @@ -180,6 +181,8 @@ for %%x in (lib libs) do ( if errorlevel 1 exit 1 if exist %SRC_DIR%\PCbuild\%HOST_DIR%\python3%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\python3%THREAD%%_D%.lib %PREFIX%\%%x\ if errorlevel 1 exit 1 + if exist %SRC_DIR%\PCbuild\%HOST_DIR%\python3t%_D%.lib copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\python3t%_D%.lib %PREFIX%\%%x\ + if errorlevel 1 exit 1 if exist %SRC_DIR%\PCbuild\%HOST_DIR%\_tkinter%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\_tkinter%THREAD%%_D%.lib %PREFIX%\%%x\ if errorlevel 1 exit 1 ) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index c30fb4c35..e9ce845e4 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -4,7 +4,7 @@ {% set ver2 = '.'.join(version.split('.')[0:2]) %} {% set ver2nd = ''.join(version.split('.')[0:2]) %} {% set ver3nd = ''.join(version.split('.')[0:3]) %} -{% set build_number = 2 %} +{% set build_number = 3 %} # this makes the linter happy {% set channel_targets = channel_targets or 'conda-forge main' %} @@ -278,6 +278,8 @@ outputs: {% else %} - if not exist %PREFIX%\\lib\\python3.lib exit 1 # [win] - if not exist %PREFIX%\\lib\\python{{ ver2nd }}.lib exit 1 # [win] + - if not exist %PREFIX%\\lib\\python3t.lib exit 1 # [win] + - python -c "import ctypes; ctypes.WinDLL('python3t').Py_IsInitialized" # [win] {% endif %} # https://github.com/conda-forge/python-feedstock/issues/384 - if exist %PREFIX%\\Scripts\\pydoc exit 1 # [win]