https://github.com/python/cpython/commit/c06f4f43015528db45bd6b44b46c057d88b38583
commit: c06f4f43015528db45bd6b44b46c057d88b38583
branch: main
author: Chris Eibl <[email protected]>
committer: zooba <[email protected]>
date: 2026-02-19T12:38:46Z
summary:

GH-144679: When building with VS 2026 on Windows, use PlatformToolset v145 by 
default (GH-144680)

files:
A Misc/NEWS.d/next/Build/2026-02-10-18-26-04.gh-issue-144679.FIH73W.rst
M PCbuild/python.props
M PCbuild/pythoncore.vcxproj
M Tools/msi/bundle/bootstrap/pythonba.vcxproj

diff --git 
a/Misc/NEWS.d/next/Build/2026-02-10-18-26-04.gh-issue-144679.FIH73W.rst 
b/Misc/NEWS.d/next/Build/2026-02-10-18-26-04.gh-issue-144679.FIH73W.rst
new file mode 100644
index 00000000000000..ebcfda54da39a7
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2026-02-10-18-26-04.gh-issue-144679.FIH73W.rst
@@ -0,0 +1,2 @@
+When building with Visual Studio 2026 (Version 18), use PlatformToolSet v145
+by default. Patch by Chris Eibl.
diff --git a/PCbuild/python.props b/PCbuild/python.props
index 82e6365bb397a5..3ad8d81dfc9a95 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -11,7 +11,7 @@
 
     We set BasePlatformToolset for ICC's benefit, it's otherwise ignored.
     -->
-    <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and 
'$(VisualStudioVersion)' == '18.0'">v143</BasePlatformToolset>
+    <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and 
'$(VisualStudioVersion)' == '18.0'">v145</BasePlatformToolset>
     <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and 
'$(VisualStudioVersion)' == '17.0'">v143</BasePlatformToolset>
     <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and 
'$(VisualStudioVersion)' == '16.0'">v142</BasePlatformToolset>
     <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and 
('$(MSBuildToolsVersion)' == '15.0' or '$(VisualStudioVersion)' == 
'15.0')">v141</BasePlatformToolset>
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 5e37dd33c849f2..61bee29c0af3d6 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -730,7 +730,7 @@
       </ClCompile>
     </ItemGroup>
   </Target>
-  <Target Name="_WarnAboutToolset" BeforeTargets="PrepareForBuild" 
Condition="$(PlatformToolset) != 'v141' and $(PlatformToolset) != 'v142' and 
$(PlatformToolset) != 'v143'">
+  <Target Name="_WarnAboutToolset" BeforeTargets="PrepareForBuild" 
Condition="$(PlatformToolset) != 'v143' and $(PlatformToolset) != 'v145'">
     <Warning Text="Toolset $(PlatformToolset) is not used for official builds. 
Your build may have errors or incompatibilities." />
   </Target>
   <Target Name="_WarnAboutZlib" BeforeTargets="PrepareForBuild" 
Condition="!$(IncludeExternals)">
diff --git a/Tools/msi/bundle/bootstrap/pythonba.vcxproj 
b/Tools/msi/bundle/bootstrap/pythonba.vcxproj
index 3970e857894ba5..4b38582f0d31e5 100644
--- a/Tools/msi/bundle/bootstrap/pythonba.vcxproj
+++ b/Tools/msi/bundle/bootstrap/pythonba.vcxproj
@@ -21,6 +21,7 @@
   <PropertyGroup Label="Globals">
     <Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
     <Platform Condition="'$(Platform)' == ''">Win32</Platform>
+    <PlatformToolset Condition="'$(PlatformToolset)' == '' and 
'$(VisualStudioVersion)' == '18.0'">v145</PlatformToolset>
     <PlatformToolset Condition="'$(PlatformToolset)' == '' and 
'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
     <PlatformToolset Condition="'$(PlatformToolset)' == '' and 
'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
     <PlatformToolset Condition="'$(PlatformToolset)' == '' and 
('$(MSBuildToolsVersion)' == '15.0' or '$(VisualStudioVersion)' == 
'15.0')">v141</PlatformToolset>

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to