From 5db5a47cbacd23a539ae76168ae4f1d41a2601ff Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 17 Apr 2026 18:53:41 +0200 Subject: [PATCH 01/20] Link against python3t.lib --- Include/pyabi.h | 2 ++ PC/pyconfig.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Include/pyabi.h b/Include/pyabi.h index 8c4ae281a43faf..21a6ab0c1ee6ea 100644 --- a/Include/pyabi.h +++ b/Include/pyabi.h @@ -55,6 +55,8 @@ * * (Don't use Py_TARGET_ABI3T directly. It's currently only used to set these * 2 macros, and defined for users' convenience.) + * + * This logic is currently partially duplicated in PC/pyconfig.h. */ #if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED) \ && !defined(Py_TARGET_ABI3T) diff --git a/PC/pyconfig.h b/PC/pyconfig.h index a126fca6f5aafb..72a475777b7ad0 100644 --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -331,7 +331,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ # if defined(Py_GIL_DISABLED) # if defined(Py_DEBUG) # pragma comment(lib,"python315t_d.lib") -# elif defined(Py_LIMITED_API) +# elif defined(Py_LIMITED_API) || defined(Py_TARGET_ABI3T) # pragma comment(lib,"python3t.lib") # else # pragma comment(lib,"python315t.lib") @@ -339,6 +339,8 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ # else /* Py_GIL_DISABLED */ # if defined(Py_DEBUG) # pragma comment(lib,"python315_d.lib") +# elif defined(Py_TARGET_ABI3T) +# pragma comment(lib,"python3t.lib") # elif defined(Py_LIMITED_API) # pragma comment(lib,"python3.lib") # else From 1153d48773f9cbb0e78c912a80bb692850fcbd98 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 21 Apr 2026 15:41:45 +0200 Subject: [PATCH 02/20] Add ABI3T_COMPAT_DLLNAME --- PCbuild/pyproject.props | 2 ++ Python/dynload_win.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 94ae718d58c4ba..0ae69705878d11 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -49,6 +49,7 @@ <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64; <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64' and $(PlatformToolset) != 'ClangCL'">_M_X64;$(_PlatformPreprocessorDefinition) <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"$(Py3DllName)$(PyDebugExt)"; + <_Abi3tCompatDllNamePreprocessorDefinition Condition="$(DisableGil) != 'true'">ABI3T_COMPAT_DLLNAME=L"$(PyAbi3tCompat3DllName)$(PyDebugExt)"; <_FreeThreadedPreprocessorDefinition Condition="$(DisableGil) == 'true'">Py_GIL_DISABLED=1; <_PymallocHugepagesPreprocessorDefinition Condition="$(UsePymallocHugepages) == 'true'">PYMALLOC_USE_HUGEPAGES=1; @@ -57,6 +58,7 @@ $(PySourcePath)Include;$(PySourcePath)Include\internal;$(PySourcePath)Include\internal\mimalloc;$(PySourcePath)PC;%(AdditionalIncludeDirectories) WIN32;$(_Py3NamePreprocessorDefinition)$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PyStatsPreprocessorDefinition)$(_PydPreprocessorDefinition)$(_FreeThreadedPreprocessorDefinition)$(_PymallocHugepagesPreprocessorDefinition)%(PreprocessorDefinitions) _Py_USING_PGO=1;%(PreprocessorDefinitions) + $(_Abi3tCompatDllNamePreprocessorDefinition)%(PreprocessorDefinitions) MaxSpeed true diff --git a/Python/dynload_win.c b/Python/dynload_win.c index de9b0a77817a63..b479595192ec84 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -169,7 +169,16 @@ _Py_CheckPython3(void) use that DLL */ if (PyWin_DLLhModule && GetModuleFileNameW(PyWin_DLLhModule, py3path, MAXPATHLEN)) { wchar_t *p = wcsrchr(py3path, L'\\'); + if (p) { +#ifdef ABI3T_COMPAT_DLLNAME + wcscpy(p + 1, ABI3T_COMPAT_DLLNAME); + hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); + if (hPython3 != NULL) { + return 1; + } +#endif + wcscpy(p + 1, PY3_DLLNAME); hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); if (hPython3 != NULL) { @@ -178,6 +187,13 @@ _Py_CheckPython3(void) } } +#ifdef ABI3T_COMPAT_DLLNAME + hPython3 = LoadLibraryExW(ABI3T_COMPAT_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); + if (hPython3 != NULL) { + return 1; + } +#endif + /* If we can locate python3.dll in our application dir, use that DLL */ hPython3 = LoadLibraryExW(PY3_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); From fda3900aa8752b17551a5ed8c8cd61057969511f Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 21 Apr 2026 16:12:14 +0200 Subject: [PATCH 03/20] Build abi3t-compat\python3t.dll --- PCbuild/abi3t-compat.vcxproj | 113 +++++++++++++++++++++++++++ PCbuild/abi3t-compat.vcxproj.filters | 23 ++++++ PCbuild/pcbuild.proj | 2 + PCbuild/pcbuild.sln | 35 +++++++++ PCbuild/pyproject.props | 2 +- PCbuild/python.props | 3 + 6 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 PCbuild/abi3t-compat.vcxproj create mode 100644 PCbuild/abi3t-compat.vcxproj.filters diff --git a/PCbuild/abi3t-compat.vcxproj b/PCbuild/abi3t-compat.vcxproj new file mode 100644 index 00000000000000..48ae567aef832f --- /dev/null +++ b/PCbuild/abi3t-compat.vcxproj @@ -0,0 +1,113 @@ + + + + + Debug + ARM + + + Debug + ARM64 + + + Debug + Win32 + + + Debug + x64 + + + PGInstrument + ARM + + + PGInstrument + ARM64 + + + PGInstrument + Win32 + + + PGInstrument + x64 + + + PGUpdate + ARM + + + PGUpdate + ARM64 + + + PGUpdate + Win32 + + + PGUpdate + x64 + + + Release + ARM + + + Release + ARM64 + + + Release + Win32 + + + Release + x64 + + + + {947BB5F5-6025-4A4F-8182-1B175469F8D2} + abi3t-compat + Win32Proj + false + + + + + $(PyAbi3tCompatDllName) + DynamicLibrary + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + $(BuildPath)$(PyAbi3tCompatDllDir)\ + + + + PYTHON_DLL_NAME="$(PyDllName)";%(PreprocessorDefinitions) + false + + + true + + + + + + + + + + + + diff --git a/PCbuild/abi3t-compat.vcxproj.filters b/PCbuild/abi3t-compat.vcxproj.filters new file mode 100644 index 00000000000000..37510e3c7398f2 --- /dev/null +++ b/PCbuild/abi3t-compat.vcxproj.filters @@ -0,0 +1,23 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + + + Resource Files + + + diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj index 7a5327bf016cea..71958f92b24328 100644 --- a/PCbuild/pcbuild.proj +++ b/PCbuild/pcbuild.proj @@ -61,6 +61,8 @@ + + diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln index 7296ea75301157..f6d445822e6dfe 100644 --- a/PCbuild/pcbuild.sln +++ b/PCbuild/pcbuild.sln @@ -33,6 +33,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", {78D80A15-BD8C-44E2-B49E-1F05B0A0A687} = {78D80A15-BD8C-44E2-B49E-1F05B0A0A687} {86937F53-C189-40EF-8CE8-8759D8E7D480} = {86937F53-C189-40EF-8CE8-8759D8E7D480} {885D4898-D08D-4091-9C40-C700CFE3FC5A} = {885D4898-D08D-4091-9C40-C700CFE3FC5A} + {947BB5F5-6025-4A4F-8182-1B175469F8D2} = {947BB5F5-6025-4A4F-8182-1B175469F8D2} {900342D7-516A-4469-B1AD-59A66E49A25F} = {900342D7-516A-4469-B1AD-59A66E49A25F} {9E48B300-37D1-11DD-8C41-005056C00008} = {9E48B300-37D1-11DD-8C41-005056C00008} {9EC7190A-249F-4180-A900-548FDCF3055F} = {9EC7190A-249F-4180-A900-548FDCF3055F} @@ -104,6 +105,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multip EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python3dll", "python3dll.vcxproj", "{885D4898-D08D-4091-9C40-C700CFE3FC5A}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "abi3t-compat", "abi3t-compat.vcxproj", "{947BB5F5-6025-4A4F-8182-1B175469F8D2}" +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xxlimited", "xxlimited.vcxproj", "{F749B822-B489-4CA5-A3AD-CE078F5F338A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testbuffer", "_testbuffer.vcxproj", "{A2697BD3-28C1-4AEC-9106-8B748639FD16}" @@ -984,6 +987,38 @@ Global {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Release|Win32.Build.0 = Release|Win32 {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Release|x64.ActiveCfg = Release|x64 {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Release|x64.Build.0 = Release|x64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Debug|ARM.ActiveCfg = Debug|ARM + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Debug|ARM.Build.0 = Debug|ARM + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Debug|ARM64.Build.0 = Debug|ARM64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Debug|Win32.ActiveCfg = Debug|Win32 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Debug|Win32.Build.0 = Debug|Win32 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Debug|x64.ActiveCfg = Debug|x64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Debug|x64.Build.0 = Debug|x64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGInstrument|ARM.ActiveCfg = PGInstrument|ARM + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGInstrument|ARM.Build.0 = PGInstrument|ARM + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGInstrument|ARM64.ActiveCfg = PGInstrument|ARM64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGInstrument|ARM64.Build.0 = PGInstrument|ARM64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGInstrument|Win32.ActiveCfg = Debug|Win32 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGInstrument|Win32.Build.0 = Debug|Win32 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGInstrument|x64.ActiveCfg = Debug|x64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGInstrument|x64.Build.0 = Debug|x64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGUpdate|ARM.ActiveCfg = PGUpdate|ARM + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGUpdate|ARM.Build.0 = PGUpdate|ARM + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGUpdate|ARM64.ActiveCfg = PGUpdate|ARM64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGUpdate|ARM64.Build.0 = PGUpdate|ARM64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGUpdate|Win32.ActiveCfg = Debug|Win32 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGUpdate|Win32.Build.0 = Debug|Win32 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGUpdate|x64.ActiveCfg = Debug|x64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.PGUpdate|x64.Build.0 = Debug|x64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Release|ARM.ActiveCfg = Release|ARM + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Release|ARM.Build.0 = Release|ARM + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Release|ARM64.ActiveCfg = Release|ARM64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Release|ARM64.Build.0 = Release|ARM64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Release|Win32.ActiveCfg = Release|Win32 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Release|Win32.Build.0 = Release|Win32 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Release|x64.ActiveCfg = Release|x64 + {947BB5F5-6025-4A4F-8182-1B175469F8D2}.Release|x64.Build.0 = Release|x64 {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Debug|ARM.ActiveCfg = Debug|ARM {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Debug|ARM64.ActiveCfg = Debug|ARM64 {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Debug|Win32.ActiveCfg = Release|Win32 diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 0ae69705878d11..5cff8777be6c40 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -49,7 +49,7 @@ <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64; <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64' and $(PlatformToolset) != 'ClangCL'">_M_X64;$(_PlatformPreprocessorDefinition) <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"$(Py3DllName)$(PyDebugExt)"; - <_Abi3tCompatDllNamePreprocessorDefinition Condition="$(DisableGil) != 'true'">ABI3T_COMPAT_DLLNAME=L"$(PyAbi3tCompat3DllName)$(PyDebugExt)"; + <_Abi3tCompatDllNamePreprocessorDefinition Condition="$(DisableGil) != 'true'">ABI3T_COMPAT_DLLNAME=L"$(PyAbi3tCompatDllDir)\\$(PyAbi3tCompatDllName)$(PyDebugExt)"; <_FreeThreadedPreprocessorDefinition Condition="$(DisableGil) == 'true'">Py_GIL_DISABLED=1; <_PymallocHugepagesPreprocessorDefinition Condition="$(UsePymallocHugepages) == 'true'">PYMALLOC_USE_HUGEPAGES=1; diff --git a/PCbuild/python.props b/PCbuild/python.props index 3ad8d81dfc9a95..28175e6b1b8f2e 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -244,6 +244,9 @@ python3t python3 + + abi3t-compat + python3t .cp$(MajorVersionNumber)$(MinorVersionNumber)-win32 From 96676cf9de9eac96fe270b430695211d081c6ecd Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 22 Apr 2026 13:47:55 +0200 Subject: [PATCH 04/20] Add abi3tcompat to MSI installer --- Tools/msi/core/core_files.wxs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tools/msi/core/core_files.wxs b/Tools/msi/core/core_files.wxs index 145e1471247aa1..b481d17a7b9397 100644 --- a/Tools/msi/core/core_files.wxs +++ b/Tools/msi/core/core_files.wxs @@ -2,6 +2,9 @@ + + + From 32083ddbbc16112d1eeb5493c7b3ade8f368fa19 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Mon, 27 Apr 2026 13:46:23 -0600 Subject: [PATCH 05/20] minimal fix for build errors on Petr's PR --- Tools/msi/common.wxs | 6 ++++++ Tools/msi/core/core_files.wxs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Tools/msi/common.wxs b/Tools/msi/common.wxs index 54fa749ab17cdd..73da474e4181f1 100644 --- a/Tools/msi/common.wxs +++ b/Tools/msi/common.wxs @@ -75,6 +75,12 @@ + + + + + + diff --git a/Tools/msi/core/core_files.wxs b/Tools/msi/core/core_files.wxs index b481d17a7b9397..02b7ef6cee0dc1 100644 --- a/Tools/msi/core/core_files.wxs +++ b/Tools/msi/core/core_files.wxs @@ -2,8 +2,8 @@ - - + + From eb614690373293127f73f626636145fa553909cd Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 28 Apr 2026 14:28:07 +0200 Subject: [PATCH 06/20] Build python3.dll & python3t.dll separately, with fixed names --- PCbuild/_remote_debugging.vcxproj | 6 +++++- PCbuild/_testcapi.vcxproj | 6 +++++- PCbuild/_testlimitedcapi.vcxproj | 6 +++++- PCbuild/pcbuild.proj | 6 +++--- PCbuild/pcbuild.sln | 2 +- PCbuild/pyproject.props | 4 ++-- PCbuild/python.props | 6 ------ PCbuild/python3dll.vcxproj | 4 ++-- PCbuild/{abi3t-compat.vcxproj => python3tdll.vcxproj} | 9 +++------ ...ompat.vcxproj.filters => python3tdll.vcxproj.filters} | 0 PCbuild/readme.txt | 4 ++++ PCbuild/xxlimited.vcxproj | 5 ++++- PCbuild/xxlimited_35.vcxproj | 5 ++++- Tools/msi/core/core_files.wxs | 2 +- 14 files changed, 39 insertions(+), 26 deletions(-) rename PCbuild/{abi3t-compat.vcxproj => python3tdll.vcxproj} (93%) rename PCbuild/{abi3t-compat.vcxproj.filters => python3tdll.vcxproj.filters} (100%) diff --git a/PCbuild/_remote_debugging.vcxproj b/PCbuild/_remote_debugging.vcxproj index 0e86ce9f4c918c..def2f5bad2b27a 100644 --- a/PCbuild/_remote_debugging.vcxproj +++ b/PCbuild/_remote_debugging.vcxproj @@ -121,10 +121,14 @@ {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} false - + {885d4898-d08d-4091-9c40-c700cfe3fc5a} false + + {947BB5F5-6025-4A4F-8182-1B175469F8D2} + false + diff --git a/PCbuild/_testcapi.vcxproj b/PCbuild/_testcapi.vcxproj index 68707a54ff6b87..4725787c59aad3 100644 --- a/PCbuild/_testcapi.vcxproj +++ b/PCbuild/_testcapi.vcxproj @@ -142,10 +142,14 @@ {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} false - + {885d4898-d08d-4091-9c40-c700cfe3fc5a} false + + {947BB5F5-6025-4A4F-8182-1B175469F8D2} + false + diff --git a/PCbuild/_testlimitedcapi.vcxproj b/PCbuild/_testlimitedcapi.vcxproj index 935467dfcb3283..af11527d43d3ae 100644 --- a/PCbuild/_testlimitedcapi.vcxproj +++ b/PCbuild/_testlimitedcapi.vcxproj @@ -125,10 +125,14 @@ {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} false - + {885d4898-d08d-4091-9c40-c700cfe3fc5a} false + + {947BB5F5-6025-4A4F-8182-1B175469F8D2} + false + diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj index 71958f92b24328..376258d75efe8a 100644 --- a/PCbuild/pcbuild.proj +++ b/PCbuild/pcbuild.proj @@ -60,9 +60,9 @@ false - - - + + + diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln index f6d445822e6dfe..b77f3f30d7a977 100644 --- a/PCbuild/pcbuild.sln +++ b/PCbuild/pcbuild.sln @@ -105,7 +105,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multip EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python3dll", "python3dll.vcxproj", "{885D4898-D08D-4091-9C40-C700CFE3FC5A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "abi3t-compat", "abi3t-compat.vcxproj", "{947BB5F5-6025-4A4F-8182-1B175469F8D2}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python3tdll", "python3tdll.vcxproj", "{947BB5F5-6025-4A4F-8182-1B175469F8D2}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xxlimited", "xxlimited.vcxproj", "{F749B822-B489-4CA5-A3AD-CE078F5F338A}" EndProject diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index b54bdebabc13bf..7103bc96334b7a 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -49,8 +49,8 @@ <_PlatformPreprocessorDefinition>_WIN32; <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64; <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64' and $(PlatformToolset) != 'ClangCL'">_M_X64;$(_PlatformPreprocessorDefinition) - <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"$(Py3DllName)$(PyDebugExt)"; - <_Abi3tCompatDllNamePreprocessorDefinition Condition="$(DisableGil) != 'true'">ABI3T_COMPAT_DLLNAME=L"$(PyAbi3tCompatDllDir)\\$(PyAbi3tCompatDllName)$(PyDebugExt)"; + <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"python3$(PyDebugExt)"; + <_Abi3tCompatDllNamePreprocessorDefinition Condition="$(DisableGil) != 'true'">ABI3T_COMPAT_DLLNAME=L"abi3t-compat\\python3t$(PyDebugExt)"; <_FreeThreadedPreprocessorDefinition Condition="$(DisableGil) == 'true'">Py_GIL_DISABLED=1; <_PymallocHugepagesPreprocessorDefinition Condition="$(UsePymallocHugepages) == 'true'">PYMALLOC_USE_HUGEPAGES=1; diff --git a/PCbuild/python.props b/PCbuild/python.props index 28175e6b1b8f2e..709a2e6bc57099 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -241,12 +241,6 @@ python$(MajorVersionNumber)$(MinorVersionNumber)t$(PyDebugExt) python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt) - - python3t - python3 - - abi3t-compat - python3t .cp$(MajorVersionNumber)$(MinorVersionNumber)-win32 diff --git a/PCbuild/python3dll.vcxproj b/PCbuild/python3dll.vcxproj index 235ea1cf9d33fb..c1864c1fd1577b 100644 --- a/PCbuild/python3dll.vcxproj +++ b/PCbuild/python3dll.vcxproj @@ -75,7 +75,7 @@ - $(Py3DllName) + python3 DynamicLibrary @@ -91,7 +91,7 @@ - PYTHON_DLL_NAME="$(PyDllName)";%(PreprocessorDefinitions) + PYTHON_DLL_NAME="python3$(PyDebugExt)";%(PreprocessorDefinitions) false diff --git a/PCbuild/abi3t-compat.vcxproj b/PCbuild/python3tdll.vcxproj similarity index 93% rename from PCbuild/abi3t-compat.vcxproj rename to PCbuild/python3tdll.vcxproj index 48ae567aef832f..e66d48cb72f23f 100644 --- a/PCbuild/abi3t-compat.vcxproj +++ b/PCbuild/python3tdll.vcxproj @@ -68,14 +68,14 @@ {947BB5F5-6025-4A4F-8182-1B175469F8D2} - abi3t-compat + python3tdll Win32Proj false - $(PyAbi3tCompatDllName) + python3t DynamicLibrary @@ -89,12 +89,9 @@ <_ProjectFileVersion>10.0.30319.1 - - $(BuildPath)$(PyAbi3tCompatDllDir)\ - - PYTHON_DLL_NAME="$(PyDllName)";%(PreprocessorDefinitions) + PYTHON_DLL_NAME="python3t$(PyDebugExt)";%(PreprocessorDefinitions) false diff --git a/PCbuild/abi3t-compat.vcxproj.filters b/PCbuild/python3tdll.vcxproj.filters similarity index 100% rename from PCbuild/abi3t-compat.vcxproj.filters rename to PCbuild/python3tdll.vcxproj.filters diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index b98a956034c537..3f41be7cff7570 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -160,6 +160,10 @@ pyshellext pyshellext.dll, the shell extension deployed with the launcher python3dll python3.dll, the PEP 384 Stable ABI dll + (missing on free-threaded builds) +python3tdll + python3t.dll, the PEP 803 free-threading Stable ABI dll + (built from the same source as python3.dll) xxlimited builds an example module that makes use of the PEP 384 Stable ABI, see Modules\xxlimited.c diff --git a/PCbuild/xxlimited.vcxproj b/PCbuild/xxlimited.vcxproj index 093e6920c0b76c..3de2ee1a18a32b 100644 --- a/PCbuild/xxlimited.vcxproj +++ b/PCbuild/xxlimited.vcxproj @@ -101,9 +101,12 @@ - + {885d4898-d08d-4091-9c40-c700cfe3fc5a} + + {947BB5F5-6025-4A4F-8182-1B175469F8D2} + diff --git a/PCbuild/xxlimited_35.vcxproj b/PCbuild/xxlimited_35.vcxproj index 3f4d4463f24af0..c1115fc0c3f811 100644 --- a/PCbuild/xxlimited_35.vcxproj +++ b/PCbuild/xxlimited_35.vcxproj @@ -101,9 +101,12 @@ - + {885d4898-d08d-4091-9c40-c700cfe3fc5a} + + {947BB5F5-6025-4A4F-8182-1B175469F8D2} + diff --git a/Tools/msi/core/core_files.wxs b/Tools/msi/core/core_files.wxs index 02b7ef6cee0dc1..577dba4df1edff 100644 --- a/Tools/msi/core/core_files.wxs +++ b/Tools/msi/core/core_files.wxs @@ -3,7 +3,7 @@ - + From 92ae7030bed99b17abb541e78bc765e69305adbb Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 28 Apr 2026 14:34:24 +0200 Subject: [PATCH 07/20] Don't use !(bindpath.build) --- Tools/msi/core/core_files.wxs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/msi/core/core_files.wxs b/Tools/msi/core/core_files.wxs index 577dba4df1edff..a8f05cd156b8ba 100644 --- a/Tools/msi/core/core_files.wxs +++ b/Tools/msi/core/core_files.wxs @@ -3,7 +3,7 @@ - + From 3dc7bc1acb84c52a138c8c3a2330cce69706e3a2 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 29 Apr 2026 08:05:39 +0200 Subject: [PATCH 08/20] Apply suggestions from code review Co-authored-by: Steve Dower Co-authored-by: Nathan Goldbaum --- PCbuild/_remote_debugging.vcxproj | 2 +- PCbuild/pcbuild.proj | 2 +- PCbuild/python3dll.vcxproj | 2 +- PCbuild/python3tdll.vcxproj | 2 +- Tools/msi/core/core_files.wxs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PCbuild/_remote_debugging.vcxproj b/PCbuild/_remote_debugging.vcxproj index def2f5bad2b27a..b58e172906dfc6 100644 --- a/PCbuild/_remote_debugging.vcxproj +++ b/PCbuild/_remote_debugging.vcxproj @@ -121,7 +121,7 @@ {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} false - + {885d4898-d08d-4091-9c40-c700cfe3fc5a} false diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj index 376258d75efe8a..bb7d8042176d8f 100644 --- a/PCbuild/pcbuild.proj +++ b/PCbuild/pcbuild.proj @@ -60,7 +60,7 @@ false - + diff --git a/PCbuild/python3dll.vcxproj b/PCbuild/python3dll.vcxproj index c1864c1fd1577b..3d8ac1b23532c1 100644 --- a/PCbuild/python3dll.vcxproj +++ b/PCbuild/python3dll.vcxproj @@ -91,7 +91,7 @@ - PYTHON_DLL_NAME="python3$(PyDebugExt)";%(PreprocessorDefinitions) + PYTHON_DLL_NAME="$(PyDllName)";%(PreprocessorDefinitions) false diff --git a/PCbuild/python3tdll.vcxproj b/PCbuild/python3tdll.vcxproj index e66d48cb72f23f..796712cca3146c 100644 --- a/PCbuild/python3tdll.vcxproj +++ b/PCbuild/python3tdll.vcxproj @@ -91,7 +91,7 @@ - PYTHON_DLL_NAME="python3t$(PyDebugExt)";%(PreprocessorDefinitions) + PYTHON_DLL_NAME="$(PyDllName)";%(PreprocessorDefinitions) false diff --git a/Tools/msi/core/core_files.wxs b/Tools/msi/core/core_files.wxs index a8f05cd156b8ba..a55b47ff2aa6dc 100644 --- a/Tools/msi/core/core_files.wxs +++ b/Tools/msi/core/core_files.wxs @@ -3,7 +3,7 @@ - + From b64ad2cddc8f42a64cec9b386ed6246d7edfa083 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 29 Apr 2026 12:17:02 +0200 Subject: [PATCH 09/20] Look for python3t.dll without the directory too --- PCbuild/pyproject.props | 3 ++- Python/dynload_win.c | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 7103bc96334b7a..271f39f4400427 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -51,6 +51,7 @@ <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64' and $(PlatformToolset) != 'ClangCL'">_M_X64;$(_PlatformPreprocessorDefinition) <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"python3$(PyDebugExt)"; <_Abi3tCompatDllNamePreprocessorDefinition Condition="$(DisableGil) != 'true'">ABI3T_COMPAT_DLLNAME=L"abi3t-compat\\python3t$(PyDebugExt)"; + <_Abi3tDllNamePreprocessorDefinition Condition="$(DisableGil) != 'true'">ABI3T_DLLNAME=L"python3t$(PyDebugExt)"; <_FreeThreadedPreprocessorDefinition Condition="$(DisableGil) == 'true'">Py_GIL_DISABLED=1; <_PymallocHugepagesPreprocessorDefinition Condition="$(UsePymallocHugepages) == 'true'">PYMALLOC_USE_HUGEPAGES=1; @@ -59,7 +60,7 @@ $(PySourcePath)Include;$(PySourcePath)Include\internal;$(PySourcePath)Include\internal\mimalloc;$(PySourcePath)PC;%(AdditionalIncludeDirectories) WIN32;$(_Py3NamePreprocessorDefinition)$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PyStatsPreprocessorDefinition)$(_PydPreprocessorDefinition)$(_FreeThreadedPreprocessorDefinition)$(_PymallocHugepagesPreprocessorDefinition)%(PreprocessorDefinitions) _Py_USING_PGO=1;%(PreprocessorDefinitions) - $(_Abi3tCompatDllNamePreprocessorDefinition)%(PreprocessorDefinitions) + $(_Abi3tCompatDllNamePreprocessorDefinition)$(_Abi3tDllNamePreprocessorDefinition)%(PreprocessorDefinitions) MaxSpeed true diff --git a/Python/dynload_win.c b/Python/dynload_win.c index b479595192ec84..84b0a94f69dd58 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -184,9 +184,19 @@ _Py_CheckPython3(void) if (hPython3 != NULL) { return 1; } + +#ifdef ABI3T_DLLNAME + wcscpy(p + 1, ABI3T_DLLNAME); + hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); + if (hPython3 != NULL) { + return 1; + } +#endif } } + /* If we can locate python3.dll in our application dir, + use that DLL */ #ifdef ABI3T_COMPAT_DLLNAME hPython3 = LoadLibraryExW(ABI3T_COMPAT_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); if (hPython3 != NULL) { @@ -194,13 +204,18 @@ _Py_CheckPython3(void) } #endif - /* If we can locate python3.dll in our application dir, - use that DLL */ hPython3 = LoadLibraryExW(PY3_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); if (hPython3 != NULL) { return 1; } +#ifdef ABI3T_DLLNAME + hPython3 = LoadLibraryExW(ABI3T_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); + if (hPython3 != NULL) { + return 1; + } +#endif + /* For back-compat, also search {sys.prefix}\DLLs, though that has not been a normal install layout for a while */ PyInterpreterState *interp = _PyInterpreterState_GET(); From 4bc0289b50739cacadba48d7e86a0fa003126cca Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 29 Apr 2026 12:53:12 +0200 Subject: [PATCH 10/20] PC/layout: Include python3t in GIL-ful builds --- PC/layout/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PC/layout/main.py b/PC/layout/main.py index 8543e7c56e1c41..34e9904f0433be 100644 --- a/PC/layout/main.py +++ b/PC/layout/main.py @@ -192,10 +192,11 @@ def in_build(f, dest="", new_name=None, no_lib=False): yield from in_build("pythonw_uwp.exe", new_name="idle{}".format(VER_DOT)) if ns.include_stable: - if ns.include_freethreaded: - yield from in_build(FREETHREADED_PYTHON_STABLE_DLL_NAME) - else: + if not ns.include_freethreaded: + # abi3 (GIL-enabled only) yield from in_build(PYTHON_STABLE_DLL_NAME) + # abi3t (compatible with both builds) + yield from in_build(FREETHREADED_PYTHON_STABLE_DLL_NAME) found_any = False for dest, src in rglob(ns.build, "vcruntime*.dll"): From 8b2981e4fcebc41f2a3f20a3041f04d106f67c98 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 30 Apr 2026 10:27:46 +0200 Subject: [PATCH 11/20] Build in the abi3t-compat directory --- PC/layout/main.py | 8 ++++---- PCbuild/python3dll.vcxproj | 3 +++ PCbuild/python3tdll.vcxproj | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/PC/layout/main.py b/PC/layout/main.py index 34e9904f0433be..bba9086589ab0f 100644 --- a/PC/layout/main.py +++ b/PC/layout/main.py @@ -192,11 +192,11 @@ def in_build(f, dest="", new_name=None, no_lib=False): yield from in_build("pythonw_uwp.exe", new_name="idle{}".format(VER_DOT)) if ns.include_stable: - if not ns.include_freethreaded: - # abi3 (GIL-enabled only) + if ns.include_freethreaded: + yield from in_build(FREETHREADED_PYTHON_STABLE_DLL_NAME) + else: yield from in_build(PYTHON_STABLE_DLL_NAME) - # abi3t (compatible with both builds) - yield from in_build(FREETHREADED_PYTHON_STABLE_DLL_NAME) + yield from in_build(f"abi3t-compat\\{FREETHREADED_PYTHON_STABLE_DLL_NAME}") found_any = False for dest, src in rglob(ns.build, "vcruntime*.dll"): diff --git a/PCbuild/python3dll.vcxproj b/PCbuild/python3dll.vcxproj index 3d8ac1b23532c1..6f715eb5773752 100644 --- a/PCbuild/python3dll.vcxproj +++ b/PCbuild/python3dll.vcxproj @@ -89,6 +89,9 @@ <_ProjectFileVersion>10.0.30319.1 + + $(BuildPath)abi3t-compat\ + PYTHON_DLL_NAME="$(PyDllName)";%(PreprocessorDefinitions) diff --git a/PCbuild/python3tdll.vcxproj b/PCbuild/python3tdll.vcxproj index 796712cca3146c..0aa3de80fccc9e 100644 --- a/PCbuild/python3tdll.vcxproj +++ b/PCbuild/python3tdll.vcxproj @@ -89,6 +89,9 @@ <_ProjectFileVersion>10.0.30319.1 + + $(BuildPath)abi3t-compat\ + PYTHON_DLL_NAME="$(PyDllName)";%(PreprocessorDefinitions) From 1cb147aaa23aa9bce53932c6fd57a109a22c1d76 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 1 May 2026 00:45:17 +0100 Subject: [PATCH 12/20] Build FT to separate directory. Start updating everything that depends on that... --- PC/layout/main.py | 13 ++- PCbuild/pyproject.props | 4 +- PCbuild/python.props | 27 ++++- PCbuild/python3dll.vcxproj | 3 - PCbuild/python3tdll.vcxproj | 3 - Python/dynload_win.c | 102 ++++++++++++------ Tools/msi/core/core_files.wxs | 3 + Tools/msi/freethreaded/freethreaded_files.wxs | 60 +++++------ Tools/msi/msi.props | 34 ++++++ 9 files changed, 170 insertions(+), 79 deletions(-) diff --git a/PC/layout/main.py b/PC/layout/main.py index bba9086589ab0f..34c8f4bf76a68a 100644 --- a/PC/layout/main.py +++ b/PC/layout/main.py @@ -127,7 +127,10 @@ def get_tcltk_lib(ns): def get_layout(ns): def in_build(f, dest="", new_name=None, no_lib=False): n, _, x = f.rpartition(".") - n = new_name or n + if new_name and new_name.endswith(f".{x}"): + n = new_name.rpartition(".")[0] + else: + n = new_name or n src = ns.build / f if ns.debug and src not in REQUIRED_DLLS: if not "_d." in src.name: @@ -161,11 +164,12 @@ def in_build(f, dest="", new_name=None, no_lib=False): source = "python_uwp.exe" sourcew = "pythonw_uwp.exe" elif ns.include_freethreaded: - source = "python{}t.exe".format(VER_DOT) - sourcew = "pythonw{}t.exe".format(VER_DOT) if not ns.include_alias: alias = [] aliasw = [] + if (VER_MAJOR, VER_MINOR, VER_MICRO, VER_FIELD4) < (3, 15, 0, 0xA8): + source = "python{}t.exe".format(VER_DOT) + sourcew = "pythonw{}t.exe".format(VER_DOT) alias.extend([ "python{}t".format(VER_DOT), "python{}t".format(VER_MAJOR) if ns.include_alias3 else None, @@ -196,7 +200,8 @@ def in_build(f, dest="", new_name=None, no_lib=False): yield from in_build(FREETHREADED_PYTHON_STABLE_DLL_NAME) else: yield from in_build(PYTHON_STABLE_DLL_NAME) - yield from in_build(f"abi3t-compat\\{FREETHREADED_PYTHON_STABLE_DLL_NAME}") + if (VER_MAJOR, VER_MINOR) >= (3, 15): + yield from in_build(FREETHREADED_PYTHON_STABLE_DLL_NAME) found_any = False for dest, src in rglob(ns.build, "vcruntime*.dll"): diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 271f39f4400427..c4a0ebb9c86a67 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -9,6 +9,7 @@ $(OutDir)\ $(MSBuildThisFileDirectory)obj\ $(Py_IntDir)\$(MajorVersionNumber)$(MinorVersionNumber)$(ArchName)_$(Configuration)\$(ProjectName)\ + $(Py_IntDir)\$(MajorVersionNumber)$(MinorVersionNumber)$(ArchName)t_$(Configuration)\$(ProjectName)\ $(IntDir.Replace(`\\`, `\`)) $(Py_IntDir)\$(MajorVersionNumber)$(MinorVersionNumber)_frozen\ $(Py_IntDir)\$(MajorVersionNumber)$(MinorVersionNumber)$(ArchName)_$(Configuration)\zlib-ng\ @@ -50,7 +51,6 @@ <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64; <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64' and $(PlatformToolset) != 'ClangCL'">_M_X64;$(_PlatformPreprocessorDefinition) <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"python3$(PyDebugExt)"; - <_Abi3tCompatDllNamePreprocessorDefinition Condition="$(DisableGil) != 'true'">ABI3T_COMPAT_DLLNAME=L"abi3t-compat\\python3t$(PyDebugExt)"; <_Abi3tDllNamePreprocessorDefinition Condition="$(DisableGil) != 'true'">ABI3T_DLLNAME=L"python3t$(PyDebugExt)"; <_FreeThreadedPreprocessorDefinition Condition="$(DisableGil) == 'true'">Py_GIL_DISABLED=1; <_PymallocHugepagesPreprocessorDefinition Condition="$(UsePymallocHugepages) == 'true'">PYMALLOC_USE_HUGEPAGES=1; @@ -60,7 +60,7 @@ $(PySourcePath)Include;$(PySourcePath)Include\internal;$(PySourcePath)Include\internal\mimalloc;$(PySourcePath)PC;%(AdditionalIncludeDirectories) WIN32;$(_Py3NamePreprocessorDefinition)$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PyStatsPreprocessorDefinition)$(_PydPreprocessorDefinition)$(_FreeThreadedPreprocessorDefinition)$(_PymallocHugepagesPreprocessorDefinition)%(PreprocessorDefinitions) _Py_USING_PGO=1;%(PreprocessorDefinitions) - $(_Abi3tCompatDllNamePreprocessorDefinition)$(_Abi3tDllNamePreprocessorDefinition)%(PreprocessorDefinitions) + $(_Abi3tDllNamePreprocessorDefinition)%(PreprocessorDefinitions) MaxSpeed true diff --git a/PCbuild/python.props b/PCbuild/python.props index 709a2e6bc57099..2f8b7f287ea92d 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -43,7 +43,7 @@ $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)\..\)) $(PySourcePath)\ - + $(PySourcePath)PCbuild\win32\ $(Py_OutDir)\win32\ $(PySourcePath)PCbuild\amd64\ @@ -52,11 +52,34 @@ $(Py_OutDir)\arm32\ $(PySourcePath)PCbuild\arm64\ $(Py_OutDir)\arm64\ + $(PySourcePath)PCbuild\win32t\ + $(Py_OutDir)\win32t\ + $(PySourcePath)PCbuild\amd64t\ + $(Py_OutDir)\amd64t\ + $(PySourcePath)PCbuild\arm32t\ + $(Py_OutDir)\arm32t\ + $(PySourcePath)PCbuild\arm64t\ + $(Py_OutDir)\arm64t\ + + + $(BuildPath32) $(BuildPath64) $(BuildPathArm32) $(BuildPathArm64) $(PySourcePath)PCbuild\$(ArchName)\ + + + + + $(BuildPath32t) + $(BuildPath64t) + $(BuildPathArm32t) + $(BuildPathArm64t) + $(PySourcePath)PCbuild\$(ArchName)t\ + + + $(BuildPath)\ $(BuildPath)instrumented\ @@ -232,10 +255,8 @@ $([msbuild]::Add($(Field3Value), 9000)) - python$(MajorVersionNumber).$(MinorVersionNumber)t python $(BuildPath)$(PyExeName)$(PyDebugExt).exe - pythonw$(MajorVersionNumber).$(MinorVersionNumber)t pythonw diff --git a/PCbuild/python3dll.vcxproj b/PCbuild/python3dll.vcxproj index 6f715eb5773752..3d8ac1b23532c1 100644 --- a/PCbuild/python3dll.vcxproj +++ b/PCbuild/python3dll.vcxproj @@ -89,9 +89,6 @@ <_ProjectFileVersion>10.0.30319.1 - - $(BuildPath)abi3t-compat\ - PYTHON_DLL_NAME="$(PyDllName)";%(PreprocessorDefinitions) diff --git a/PCbuild/python3tdll.vcxproj b/PCbuild/python3tdll.vcxproj index 0aa3de80fccc9e..796712cca3146c 100644 --- a/PCbuild/python3tdll.vcxproj +++ b/PCbuild/python3tdll.vcxproj @@ -89,9 +89,6 @@ <_ProjectFileVersion>10.0.30319.1 - - $(BuildPath)abi3t-compat\ - PYTHON_DLL_NAME="$(PyDllName)";%(PreprocessorDefinitions) diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 84b0a94f69dd58..da89f4bd4647e1 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -171,50 +171,20 @@ _Py_CheckPython3(void) wchar_t *p = wcsrchr(py3path, L'\\'); if (p) { -#ifdef ABI3T_COMPAT_DLLNAME - wcscpy(p + 1, ABI3T_COMPAT_DLLNAME); - hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); - if (hPython3 != NULL) { - return 1; - } -#endif - - wcscpy(p + 1, PY3_DLLNAME); + wcscpy(p + 1, PY3_DLLNAME L".dll"); hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); - if (hPython3 != NULL) { + if (hPython3) { return 1; } - -#ifdef ABI3T_DLLNAME - wcscpy(p + 1, ABI3T_DLLNAME); - hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); - if (hPython3 != NULL) { - return 1; - } -#endif } } /* If we can locate python3.dll in our application dir, use that DLL */ -#ifdef ABI3T_COMPAT_DLLNAME - hPython3 = LoadLibraryExW(ABI3T_COMPAT_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); + hPython3 = LoadLibraryExW(PY3_DLLNAME L".dll", NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); if (hPython3 != NULL) { return 1; } -#endif - - hPython3 = LoadLibraryExW(PY3_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); - if (hPython3 != NULL) { - return 1; - } - -#ifdef ABI3T_DLLNAME - hPython3 = LoadLibraryExW(ABI3T_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); - if (hPython3 != NULL) { - return 1; - } -#endif /* For back-compat, also search {sys.prefix}\DLLs, though that has not been a normal install layout for a while */ @@ -223,13 +193,76 @@ _Py_CheckPython3(void) assert(config->prefix); if (config->prefix) { wcscpy_s(py3path, MAXPATHLEN, config->prefix); - if (py3path[0] && _Py_add_relfile(py3path, L"DLLs\\" PY3_DLLNAME, MAXPATHLEN) >= 0) { + if (py3path[0] && _Py_add_relfile(py3path, L"DLLs\\" PY3_DLLNAME L".dll", MAXPATHLEN) >= 0) { hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); } } return hPython3 != NULL; #undef MAXPATHLEN } + +/* To support extensions that can load with both abi3 and abi3t, we also need to + * preload python3t.dll. Due to 3.15 still supporting intermingled layouts, the + * check is a bit more complicated on that version as we need to try loading + * from a subdirectory first in case the adjacent python3t.dll is meant for + * python315t.dll (and we are python315.dll). + * ABI3T_DLLNAME is undefined for free-threaded builds, and so this function is + * a no-op (we assume that _Py_CheckPython3 has already been called). + */ +static int +_Py_CheckPython3t(void) +{ +#ifndef ABI3T_DLLNAME + return 1; +#else +#if PY_MAJOR_VERSION==3 && PY_MINOR_VERSION==15 + #define ABI3T_COMPAT_DLLNAME L"abi3t-compat\\" ABI3T_DLLNAME L".dll" +#endif + static int python3t_checked = 0; + static HANDLE hPython3t; + #define MAXPATHLEN 512 + wchar_t py3path[MAXPATHLEN+1]; + if (python3t_checked) { + return hPython3t != NULL; + } + python3t_checked = 1; + + /* If there is a python3t.dll [in the abi3t-compat dir] next to the + python3y.dll, use that DLL */ + if (PyWin_DLLhModule && GetModuleFileNameW(PyWin_DLLhModule, py3path, MAXPATHLEN)) { + wchar_t *p = wcsrchr(py3path, L'\\'); + + if (p) { +#ifdef ABI3T_COMPAT_DLLNAME + wcscpy(p + 1, ABI3T_COMPAT_DLLNAME); + hPython3t = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); + if (hPython3t == NULL) +#endif + { + wcscpy(p + 1, ABI3T_DLLNAME L".dll"); + hPython3t = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); + } + if (hPython3t) { + return 1; + } + } + } + + /* If we can locate python3.dll in our application dir, + use that DLL */ +#ifdef ABI3T_COMPAT_DLLNAME + hPython3t = LoadLibraryExW(ABI3T_COMPAT_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); + #undef ABI3T_COMPAT_DLLNAME + if (hPython3t == NULL) +#endif + { + hPython3t = LoadLibraryExW(ABI3T_DLLNAME L".dll", NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); + } + return hPython3t != NULL; + #undef MAXPATHLEN +#endif /* ABI3T_DLLNAME */ +} + #endif /* Py_ENABLE_SHARED */ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, @@ -241,6 +274,7 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, #ifdef Py_ENABLE_SHARED _Py_CheckPython3(); + _Py_CheckPython3t(); #endif /* Py_ENABLE_SHARED */ wchar_t *wpathname = PyUnicode_AsWideCharString(pathname, NULL); diff --git a/Tools/msi/core/core_files.wxs b/Tools/msi/core/core_files.wxs index a55b47ff2aa6dc..8b21501078ea2e 100644 --- a/Tools/msi/core/core_files.wxs +++ b/Tools/msi/core/core_files.wxs @@ -22,6 +22,9 @@ + + + diff --git a/Tools/msi/freethreaded/freethreaded_files.wxs b/Tools/msi/freethreaded/freethreaded_files.wxs index 0707e77b5e9ab2..53f723a8982807 100644 --- a/Tools/msi/freethreaded/freethreaded_files.wxs +++ b/Tools/msi/freethreaded/freethreaded_files.wxs @@ -29,7 +29,7 @@ - + @@ -37,68 +37,68 @@ - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + @@ -111,16 +111,16 @@ - + - + - + @@ -132,16 +132,16 @@ - + - + - + @@ -151,21 +151,21 @@ - + - + - - + + - - + + diff --git a/Tools/msi/msi.props b/Tools/msi/msi.props index 372c4823bce07f..097af60715448f 100644 --- a/Tools/msi/msi.props +++ b/Tools/msi/msi.props @@ -122,6 +122,30 @@ + + + build + + + build + + + build + + + build_t + + + build_t + + + build_t + + src @@ -131,6 +155,7 @@ redist + build32 @@ -140,6 +165,15 @@ buildarm64 + + build32t + + + build64t + + + buildarm64t + From 555d0169e36f06434c2629fdb3f616f257a39b2b Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 1 May 2026 11:27:58 +0100 Subject: [PATCH 13/20] Fix bindpath and simplify some settings --- PC/layout/main.py | 8 ++- PCbuild/pyproject.props | 11 ++-- PCbuild/python.props | 4 ++ PCbuild/pythoncore.vcxproj | 5 +- Python/dynload_win.c | 4 ++ Tools/msi/freethreaded/freethreaded_files.wxs | 60 +++++++++---------- 6 files changed, 55 insertions(+), 37 deletions(-) diff --git a/PC/layout/main.py b/PC/layout/main.py index 34c8f4bf76a68a..22ed0db9c921fd 100644 --- a/PC/layout/main.py +++ b/PC/layout/main.py @@ -167,6 +167,7 @@ def in_build(f, dest="", new_name=None, no_lib=False): if not ns.include_alias: alias = [] aliasw = [] + # TODO: Update 0xA8 to 0xB0 before merging if (VER_MAJOR, VER_MINOR, VER_MICRO, VER_FIELD4) < (3, 15, 0, 0xA8): source = "python{}t.exe".format(VER_DOT) sourcew = "pythonw{}t.exe".format(VER_DOT) @@ -200,7 +201,8 @@ def in_build(f, dest="", new_name=None, no_lib=False): yield from in_build(FREETHREADED_PYTHON_STABLE_DLL_NAME) else: yield from in_build(PYTHON_STABLE_DLL_NAME) - if (VER_MAJOR, VER_MINOR) >= (3, 15): + # TODO: Update 0xA8 to 0xB0 before merging + if (VER_MAJOR, VER_MINOR) >= (3, 15, 0, 0xB0): yield from in_build(FREETHREADED_PYTHON_STABLE_DLL_NAME) found_any = False @@ -675,6 +677,10 @@ def main(): from .support.arch import calculate_from_build_dir ns.arch = calculate_from_build_dir(ns.build) + if ns.arch.endswith("t"): + ns.arch = ns.arch[:-1] + ns.include_freethreaded = True + expect = f"{VER_MAJOR}.{VER_MINOR}.{VER_MICRO}{VER_SUFFIX}" actual = check_patchlevel_version(ns.source) if actual and actual != expect: diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index c4a0ebb9c86a67..7435c53e3fdcf9 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -43,6 +43,10 @@ + <_DebugPreprocessorDefinition>NDEBUG; <_DebugPreprocessorDefinition Condition="$(Configuration) == 'Debug'">_DEBUG; <_PyStatsPreprocessorDefinition>PyStats; @@ -50,17 +54,14 @@ <_PlatformPreprocessorDefinition>_WIN32; <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64; <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64' and $(PlatformToolset) != 'ClangCL'">_M_X64;$(_PlatformPreprocessorDefinition) - <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"python3$(PyDebugExt)"; - <_Abi3tDllNamePreprocessorDefinition Condition="$(DisableGil) != 'true'">ABI3T_DLLNAME=L"python3t$(PyDebugExt)"; <_FreeThreadedPreprocessorDefinition Condition="$(DisableGil) == 'true'">Py_GIL_DISABLED=1; <_PymallocHugepagesPreprocessorDefinition Condition="$(UsePymallocHugepages) == 'true'">PYMALLOC_USE_HUGEPAGES=1; + <_PyUsingPgoPreprocessorDefinition Condition="'$(SupportPGO)' and ($(Configuration) == 'PGInstrument' or $(Configuration) == 'PGUpdate')">_Py_USING_PGO=1; $(PySourcePath)Include;$(PySourcePath)Include\internal;$(PySourcePath)Include\internal\mimalloc;$(PySourcePath)PC;%(AdditionalIncludeDirectories) - WIN32;$(_Py3NamePreprocessorDefinition)$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PyStatsPreprocessorDefinition)$(_PydPreprocessorDefinition)$(_FreeThreadedPreprocessorDefinition)$(_PymallocHugepagesPreprocessorDefinition)%(PreprocessorDefinitions) - _Py_USING_PGO=1;%(PreprocessorDefinitions) - $(_Abi3tDllNamePreprocessorDefinition)%(PreprocessorDefinitions) + WIN32;$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PyStatsPreprocessorDefinition)$(_PydPreprocessorDefinition)$(_FreeThreadedPreprocessorDefinition)$(_PymallocHugepagesPreprocessorDefinition)$(_PyUsingPgoPreprocessorDefinition)%(PreprocessorDefinitions) MaxSpeed true diff --git a/PCbuild/python.props b/PCbuild/python.props index 2f8b7f287ea92d..998ae6efb7ce94 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -263,6 +263,10 @@ python$(MajorVersionNumber)$(MinorVersionNumber)t$(PyDebugExt) python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt) + + python3 + python3t + .cp$(MajorVersionNumber)$(MinorVersionNumber)-win32 .cp$(MajorVersionNumber)$(MinorVersionNumber)-win_arm32 diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index fb9217fee8bd73..75555382c33413 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -618,7 +618,10 @@ - + + PY3_DLLNAME=L"$(Py3DllName)";%(PreprocessorDefinitions) + ABI3T_DLLNAME=L"$(Abi3tDllName)";%(PreprocessorDefinitions) + diff --git a/Python/dynload_win.c b/Python/dynload_win.c index da89f4bd4647e1..a6925b7c580710 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -156,6 +156,9 @@ extern HMODULE PyWin_DLLhModule; static int _Py_CheckPython3(void) { +#ifndef PY3_DLLNAME + return 1; +#else static int python3_checked = 0; static HANDLE hPython3; #define MAXPATHLEN 512 @@ -199,6 +202,7 @@ _Py_CheckPython3(void) } return hPython3 != NULL; #undef MAXPATHLEN +#endif /* PY3_DLLNAME */ } /* To support extensions that can load with both abi3 and abi3t, we also need to diff --git a/Tools/msi/freethreaded/freethreaded_files.wxs b/Tools/msi/freethreaded/freethreaded_files.wxs index 53f723a8982807..c53b177dbe32e4 100644 --- a/Tools/msi/freethreaded/freethreaded_files.wxs +++ b/Tools/msi/freethreaded/freethreaded_files.wxs @@ -29,7 +29,7 @@ - + @@ -37,68 +37,68 @@ - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + @@ -111,16 +111,16 @@ - + - + - + @@ -132,16 +132,16 @@ - + - + - + @@ -151,21 +151,21 @@ - + - + - - + + - - + + From 90681fc0e248e59b9194f7dc87b2ec3f444350bd Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 1 May 2026 11:56:36 +0100 Subject: [PATCH 14/20] Fix zlib-ng generator and MSI paths --- PCbuild/zlib-ng.vcxproj | 6 ++++-- Tools/msi/freethreaded/freethreaded_files.wxs | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/PCbuild/zlib-ng.vcxproj b/PCbuild/zlib-ng.vcxproj index de1698ae718473..ffe8e70f2dbbc7 100644 --- a/PCbuild/zlib-ng.vcxproj +++ b/PCbuild/zlib-ng.vcxproj @@ -219,13 +219,15 @@ $([System.IO.File]::ReadAllText('$(zlibNgDir)\zlib.h.in').Replace('@ZLIB_SYMBOL_PREFIX@', '')) - + + $([System.IO.File]::ReadAllText('$(zlibNgDir)\zlib-ng.h.in').Replace('@ZLIB_SYMBOL_PREFIX@', '')) - + + + - + - + From 4bf0990dad8f7fc5c89ebfaf9dd65cbc021b4c25 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 1 May 2026 12:05:16 +0100 Subject: [PATCH 15/20] Add NEWS and update rt.bat --- .../Build/2026-05-01-12-01-54.gh-issue-148690.oTtYk-.rst | 4 ++++ .../2026-05-01-12-03-39.gh-issue-148690.TMV8dU.rst | 3 +++ PCbuild/rt.bat | 8 ++++---- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2026-05-01-12-01-54.gh-issue-148690.oTtYk-.rst create mode 100644 Misc/NEWS.d/next/Windows/2026-05-01-12-03-39.gh-issue-148690.TMV8dU.rst diff --git a/Misc/NEWS.d/next/Build/2026-05-01-12-01-54.gh-issue-148690.oTtYk-.rst b/Misc/NEWS.d/next/Build/2026-05-01-12-01-54.gh-issue-148690.oTtYk-.rst new file mode 100644 index 00000000000000..6845bad2b278de --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-05-01-12-01-54.gh-issue-148690.oTtYk-.rst @@ -0,0 +1,4 @@ +Windows free-threaded builds now output to a different default path with +default filenames, for example, ``PCbuild/amd64t/python.exe`` rather than +``PCbuild/amd64/python3.15t.exe``. The ``PC/layout`` script has been updated +to ensure compatibility of generated layouts. diff --git a/Misc/NEWS.d/next/Windows/2026-05-01-12-03-39.gh-issue-148690.TMV8dU.rst b/Misc/NEWS.d/next/Windows/2026-05-01-12-03-39.gh-issue-148690.TMV8dU.rst new file mode 100644 index 00000000000000..1fa30f10e0e3dc --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2026-05-01-12-03-39.gh-issue-148690.TMV8dU.rst @@ -0,0 +1,3 @@ +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. diff --git a/PCbuild/rt.bat b/PCbuild/rt.bat index f1e0607393405b..d5c9a24f292327 100644 --- a/PCbuild/rt.bat +++ b/PCbuild/rt.bat @@ -32,6 +32,7 @@ setlocal set pcbuild=%~dp0 set pyname=python set suffix= +set suffix1= set qmode= set dashO= set regrtestargs=--fast-ci @@ -41,8 +42,7 @@ set exe= if "%~1"=="-O" (set dashO=-O) & shift & goto CheckOpts if "%~1"=="-q" (set qmode=yes) & shift & goto CheckOpts if "%~1"=="-d" (set suffix=_d) & shift & goto CheckOpts -rem HACK: Need some way to infer the version number in this script -if "%~1"=="--disable-gil" (set pyname=python3.15t) & shift & goto CheckOpts +if "%~1"=="--disable-gil" (set suffix1=t) & shift & goto CheckOpts if "%~1"=="-win32" (set prefix=%pcbuild%win32) & shift & goto CheckOpts if "%~1"=="-x64" (set prefix=%pcbuild%amd64) & shift & goto CheckOpts if "%~1"=="-amd64" (set prefix=%pcbuild%amd64) & shift & goto CheckOpts @@ -52,7 +52,7 @@ if "%~1"=="-p" (call :SetPlatform %~2) & shift & shift & goto CheckOpts if NOT "%~1"=="" (set regrtestargs=%regrtestargs% %~1) & shift & goto CheckOpts if not defined prefix set prefix=%pcbuild%amd64 -set exe=%prefix%\%pyname%%suffix%.exe +set exe=%prefix%%suffix1%\%pyname%%suffix%.exe set cmd="%exe%" %dashO% -m test %regrtestargs% if defined qmode goto Qmode @@ -60,7 +60,7 @@ echo Deleting .pyc files ... "%exe%" "%pcbuild%rmpyc.py" echo Cleaning _pth files ... -if exist %prefix%\*._pth del %prefix%\*._pth +if exist %prefix%%suffix1%\*._pth del %prefix%%suffix1%\*._pth echo on %cmd% From ee8d037f93b89a38d7a87d912e907924007783ae Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 1 May 2026 12:39:36 +0100 Subject: [PATCH 16/20] Fix venv --- Lib/venv/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py index 21f82125f5a7c4..002f4ebc988a3b 100644 --- a/Lib/venv/__init__.py +++ b/Lib/venv/__init__.py @@ -358,6 +358,9 @@ def setup_python(self, context): exe_t = f'3.{sys.version_info[1]}t' python_exe = os.path.join(dirname, f'python{exe_t}{exe_d}.exe') pythonw_exe = os.path.join(dirname, f'pythonw{exe_t}{exe_d}.exe') + if not os.path.isfile(python_exe): + python_exe = os.path.join(dirname, f'python{exe_d}.exe') + pythonw_exe = os.path.join(dirname, f'pythonw{exe_d}.exe') link_sources = { 'python.exe': python_exe, f'python{exe_d}.exe': python_exe, From b40f782217a8419828a4e88816fc78a70e84f117 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 1 May 2026 13:15:17 +0100 Subject: [PATCH 17/20] Revert unneeded changes --- PC/layout/main.py | 4 ---- PCbuild/_testcapi.vcxproj | 2 +- PCbuild/_testlimitedcapi.vcxproj | 2 +- PCbuild/pcbuild.sln | 34 ++++++++++++++++++++++++++++++++ PCbuild/readme.txt | 2 +- PCbuild/xxlimited.vcxproj | 4 ++-- PCbuild/xxlimited_35.vcxproj | 4 ++-- 7 files changed, 41 insertions(+), 11 deletions(-) diff --git a/PC/layout/main.py b/PC/layout/main.py index 22ed0db9c921fd..63690bc24c23f2 100644 --- a/PC/layout/main.py +++ b/PC/layout/main.py @@ -677,10 +677,6 @@ def main(): from .support.arch import calculate_from_build_dir ns.arch = calculate_from_build_dir(ns.build) - if ns.arch.endswith("t"): - ns.arch = ns.arch[:-1] - ns.include_freethreaded = True - expect = f"{VER_MAJOR}.{VER_MINOR}.{VER_MICRO}{VER_SUFFIX}" actual = check_patchlevel_version(ns.source) if actual and actual != expect: diff --git a/PCbuild/_testcapi.vcxproj b/PCbuild/_testcapi.vcxproj index 4725787c59aad3..62312acf248b91 100644 --- a/PCbuild/_testcapi.vcxproj +++ b/PCbuild/_testcapi.vcxproj @@ -142,7 +142,7 @@ {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} false - + {885d4898-d08d-4091-9c40-c700cfe3fc5a} false diff --git a/PCbuild/_testlimitedcapi.vcxproj b/PCbuild/_testlimitedcapi.vcxproj index af11527d43d3ae..3d70517fbe31e8 100644 --- a/PCbuild/_testlimitedcapi.vcxproj +++ b/PCbuild/_testlimitedcapi.vcxproj @@ -125,7 +125,7 @@ {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} false - + {885d4898-d08d-4091-9c40-c700cfe3fc5a} false diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln index b77f3f30d7a977..09a989d38648df 100644 --- a/PCbuild/pcbuild.sln +++ b/PCbuild/pcbuild.sln @@ -171,6 +171,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_remote_debugging", "_remot EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_zstd", "_zstd.vcxproj", "{07029B86-F3E9-443E-86FB-78AA6D47FED1}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xxlimited_35", "xxlimited_35.vcxproj", "{FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM = Debug|ARM @@ -1820,6 +1822,38 @@ Global {07029B86-F3E9-443E-86FB-78AA6D47FED1}.Release|Win32.Build.0 = Release|Win32 {07029B86-F3E9-443E-86FB-78AA6D47FED1}.Release|x64.ActiveCfg = Release|x64 {07029B86-F3E9-443E-86FB-78AA6D47FED1}.Release|x64.Build.0 = Release|x64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Debug|ARM.ActiveCfg = Debug|ARM + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Debug|ARM.Build.0 = Debug|ARM + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Debug|ARM64.Build.0 = Debug|ARM64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Debug|Win32.ActiveCfg = Debug|Win32 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Debug|Win32.Build.0 = Debug|Win32 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Debug|x64.ActiveCfg = Debug|x64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Debug|x64.Build.0 = Debug|x64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGInstrument|ARM.ActiveCfg = PGInstrument|ARM + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGInstrument|ARM.Build.0 = PGInstrument|ARM + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGInstrument|ARM64.ActiveCfg = PGInstrument|ARM64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGInstrument|ARM64.Build.0 = PGInstrument|ARM64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGInstrument|Win32.Build.0 = PGInstrument|Win32 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGInstrument|x64.ActiveCfg = PGInstrument|x64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGInstrument|x64.Build.0 = PGInstrument|x64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGUpdate|ARM.ActiveCfg = PGUpdate|ARM + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGUpdate|ARM.Build.0 = PGUpdate|ARM + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGUpdate|ARM64.ActiveCfg = PGUpdate|ARM64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGUpdate|ARM64.Build.0 = PGUpdate|ARM64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGUpdate|Win32.Build.0 = PGUpdate|Win32 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGUpdate|x64.ActiveCfg = PGUpdate|x64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.PGUpdate|x64.Build.0 = PGUpdate|x64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Release|ARM.ActiveCfg = Release|ARM + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Release|ARM.Build.0 = Release|ARM + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Release|ARM64.ActiveCfg = Release|ARM64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Release|ARM64.Build.0 = Release|ARM64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Release|Win32.ActiveCfg = Release|Win32 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Release|Win32.Build.0 = Release|Win32 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Release|x64.ActiveCfg = Release|x64 + {FB868EA7-F93A-4D9B-BE78-CA4E9BA14FFF}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index 3f41be7cff7570..c291b7f86325f2 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -160,7 +160,7 @@ pyshellext pyshellext.dll, the shell extension deployed with the launcher python3dll python3.dll, the PEP 384 Stable ABI dll - (missing on free-threaded builds) + (not installed on free-threaded builds) python3tdll python3t.dll, the PEP 803 free-threading Stable ABI dll (built from the same source as python3.dll) diff --git a/PCbuild/xxlimited.vcxproj b/PCbuild/xxlimited.vcxproj index 3de2ee1a18a32b..f0c3616600148f 100644 --- a/PCbuild/xxlimited.vcxproj +++ b/PCbuild/xxlimited.vcxproj @@ -101,10 +101,10 @@ - + {885d4898-d08d-4091-9c40-c700cfe3fc5a} - + {947BB5F5-6025-4A4F-8182-1B175469F8D2} diff --git a/PCbuild/xxlimited_35.vcxproj b/PCbuild/xxlimited_35.vcxproj index c1115fc0c3f811..bfaf4e253664d4 100644 --- a/PCbuild/xxlimited_35.vcxproj +++ b/PCbuild/xxlimited_35.vcxproj @@ -101,10 +101,10 @@ - + {885d4898-d08d-4091-9c40-c700cfe3fc5a} - + {947BB5F5-6025-4A4F-8182-1B175469F8D2} From 65d7291818e94879b882c1619ec0ccd044ce58ff Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 1 May 2026 14:18:50 +0100 Subject: [PATCH 18/20] Fix version check for testing --- PC/layout/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PC/layout/main.py b/PC/layout/main.py index 63690bc24c23f2..bc1a9c40d53a6a 100644 --- a/PC/layout/main.py +++ b/PC/layout/main.py @@ -202,7 +202,7 @@ def in_build(f, dest="", new_name=None, no_lib=False): else: yield from in_build(PYTHON_STABLE_DLL_NAME) # TODO: Update 0xA8 to 0xB0 before merging - if (VER_MAJOR, VER_MINOR) >= (3, 15, 0, 0xB0): + if (VER_MAJOR, VER_MINOR) >= (3, 15, 0, 0xA8): yield from in_build(FREETHREADED_PYTHON_STABLE_DLL_NAME) found_any = False From 095886a22bb1527dbc95124f1212f8f675702e9b Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 1 May 2026 18:25:47 +0100 Subject: [PATCH 19/20] Fix comparison --- PC/layout/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PC/layout/main.py b/PC/layout/main.py index bc1a9c40d53a6a..c2b49558fae0f5 100644 --- a/PC/layout/main.py +++ b/PC/layout/main.py @@ -202,7 +202,7 @@ def in_build(f, dest="", new_name=None, no_lib=False): else: yield from in_build(PYTHON_STABLE_DLL_NAME) # TODO: Update 0xA8 to 0xB0 before merging - if (VER_MAJOR, VER_MINOR) >= (3, 15, 0, 0xA8): + if (VER_MAJOR, VER_MINOR, VER_MICRO, VER_FIELD4) >= (3, 15, 0, 0xA8): yield from in_build(FREETHREADED_PYTHON_STABLE_DLL_NAME) found_any = False From d7eb396e482035bf9c860c27d32973d2206c1126 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 1 May 2026 19:26:34 +0100 Subject: [PATCH 20/20] Fix version check --- PC/layout/main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PC/layout/main.py b/PC/layout/main.py index c2b49558fae0f5..3566b8bd873874 100644 --- a/PC/layout/main.py +++ b/PC/layout/main.py @@ -167,8 +167,7 @@ def in_build(f, dest="", new_name=None, no_lib=False): if not ns.include_alias: alias = [] aliasw = [] - # TODO: Update 0xA8 to 0xB0 before merging - if (VER_MAJOR, VER_MINOR, VER_MICRO, VER_FIELD4) < (3, 15, 0, 0xA8): + if (VER_MAJOR, VER_MINOR, VER_MICRO, VER_FIELD4) < (3, 15, 0, 0xB0): source = "python{}t.exe".format(VER_DOT) sourcew = "pythonw{}t.exe".format(VER_DOT) alias.extend([ @@ -201,8 +200,7 @@ def in_build(f, dest="", new_name=None, no_lib=False): yield from in_build(FREETHREADED_PYTHON_STABLE_DLL_NAME) else: yield from in_build(PYTHON_STABLE_DLL_NAME) - # TODO: Update 0xA8 to 0xB0 before merging - if (VER_MAJOR, VER_MINOR, VER_MICRO, VER_FIELD4) >= (3, 15, 0, 0xA8): + if (VER_MAJOR, VER_MINOR, VER_MICRO, VER_FIELD4) >= (3, 15, 0, 0xB0): yield from in_build(FREETHREADED_PYTHON_STABLE_DLL_NAME) found_any = False