Hi! I hit this problem while preparing for 3.15 on resvg-py - conda-forge/resvg-py-feedstock#12.
Branch main. Observed on win-64 with python 3.15.0rc2 h53f6dd8_102_cp315(conda-forge/label/python_rc).
Extensions linked against the free-threading stable ABI (abi3t, PEP 803) fail to import on GIL-enabled CPython 3.15:
ImportError: DLL load failed while importing resvg_py: The specified module could not be found.
The missing dependency is python3t.dll:
3.15 (fails) 3.14 (works)
├─ python3t.dll └─ python3.dll (python)
Reproducible in any GIL-enabled 3.15 prefix on Windows:
python -c "import ctypes; ctypes.CDLL('python3t.dll')"
This is the intended path, not misuse: on 3.15 abi3t is compatible with both GIL-enabled and free-threaded builds, and PEP 803 encourages shipping one binary tagged abi3.abi3t. Upstream supports loading it — Misc/NEWS.d/3.15.0b1.rst:
Non-freethreaded builds on Windows now support extensions linked to python3t.dll, and will
include a copy of that library in normal installs that references the non-freethreaded runtime.
Cause
recipe/build_base.bat:83 sets THREAD= for GIL builds (t for free-threaded), so the root
staging loop
for %%x in (python%VERNODOTS%%THREAD%%_D%.dll python3%THREAD%%_D%.dll ...) do (
expands to python315.dll + python3.dll and never copies python3t.dll. The for %%x in (lib libs) loop below has the same gap for python3t.lib.
PCbuild/pcbuild.proj builds python3tdll.vcxproj unconditionally, and PCbuild/python.props sets PyDllName=python315 when DisableGil != true — so the GIL build tree already holds a python3t.dll that forwards to python315.dll.
Evidence
Hit in conda-forge/resvg-py-feedstock#12:
win_64 … cp315 fails while every Linux and macOS 3.15 job passes, since extension-module
leaves libpython unlinked on ELF/Mach-O and there is nothing to resolve there.
Suggested fix
Stage python3t.dll and python3t.lib in the non-free-threaded branch of build_base.bat, adjacent to python315.dll — which is what the upstream installer does
(PC/layout/main.py:200-206 @ v3.15.0rc2):
Hi! I hit this problem while preparing for 3.15 on resvg-py - conda-forge/resvg-py-feedstock#12.
Branch
main. Observed on win-64 withpython 3.15.0rc2 h53f6dd8_102_cp315(conda-forge/label/python_rc).Extensions linked against the free-threading stable ABI (
abi3t, PEP 803) fail to import on GIL-enabled CPython 3.15:The missing dependency is
python3t.dll:Reproducible in any GIL-enabled 3.15 prefix on Windows:
This is the intended path, not misuse: on 3.15
abi3tis compatible with both GIL-enabled and free-threaded builds, and PEP 803 encourages shipping one binary taggedabi3.abi3t. Upstream supports loading it —Misc/NEWS.d/3.15.0b1.rst:Cause
recipe/build_base.bat:83setsTHREAD=for GIL builds (tfor free-threaded), so the rootstaging loop
expands to
python315.dll+python3.dlland never copiespython3t.dll. Thefor %%x in (lib libs)loop below has the same gap forpython3t.lib.PCbuild/pcbuild.projbuildspython3tdll.vcxprojunconditionally, andPCbuild/python.propssetsPyDllName=python315whenDisableGil != true— so the GIL build tree already holds apython3t.dllthat forwards topython315.dll.Evidence
Hit in conda-forge/resvg-py-feedstock#12:
win_64 … cp315fails while every Linux and macOS 3.15 job passes, sinceextension-moduleleaves libpython unlinked on ELF/Mach-O and there is nothing to resolve there.
Suggested fix
Stage
python3t.dllandpython3t.libin the non-free-threaded branch ofbuild_base.bat, adjacent topython315.dll— which is what the upstream installer does(
PC/layout/main.py:200-206@v3.15.0rc2):