Skip to content

Commit 27a62e7

Browse files
authored
pythongh-124102: Update internal PCbuild docs to accurately list build dependencies (pythonGH-124103)
1 parent 8a2baed commit 27a62e7

11 files changed

+24
-49
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Update internal documentation under PCbuild, so it now correctly states that
2+
Windows requires VS2017 or later and Python 3.10 or later

PCbuild/build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ echo.version(s) of Microsoft Visual Studio to be installed (see readme.txt).
88
echo.
99
echo.After the flags recognized by this script, up to 9 arguments to be passed
1010
echo.directly to MSBuild may be passed. If the argument contains an '=', the
11-
echo.entire argument must be quoted (e.g. `%~nx0 "/p:PlatformToolset=v100"`).
11+
echo.entire argument must be quoted (e.g. `%~nx0 "/p:PlatformToolset=v141"`).
1212
echo.Alternatively you can put extra flags for MSBuild in a file named
1313
echo.`msbuild.rsp` in the `PCbuild` directory, one flag per line. This file
1414
echo.will be picked automatically by MSBuild. Flags put in this file does not

PCbuild/env.bat

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ rem command window. However, most builds of Python will ignore the version
44
rem of the tools on PATH and use PlatformToolset instead. Ideally, both sets of
55
rem tools should be the same version to avoid potential conflicts.
66
rem
7-
rem To build Python with an earlier toolset, pass "/p:PlatformToolset=v100" (or
8-
rem 'v110', 'v120' or 'v140') to the build script.
7+
rem To build Python with an earlier toolset, pass "/p:PlatformToolset=v141" (or
8+
rem 'v142', 'v143') to the build script.
99

1010
echo Build environments: x86, amd64, x86_amd64
1111
echo.
@@ -20,8 +20,7 @@ call "%VSTOOLS%" %_ARGS%
2020
exit /B 0
2121

2222
:skip_vswhere
23-
if not defined VSTOOLS set VSTOOLS=%VS140COMNTOOLS%
24-
if not defined VSTOOLS set VSTOOLS=%VS120COMNTOOLS%
25-
if not defined VSTOOLS set VSTOOLS=%VS110COMNTOOLS%
26-
if not defined VSTOOLS set VSTOOLS=%VS100COMNTOOLS%
23+
if not defined VSTOOLS set VSTOOLS=%VS143COMNTOOLS%
24+
if not defined VSTOOLS set VSTOOLS=%VS142COMNTOOLS%
25+
if not defined VSTOOLS set VSTOOLS=%VS141COMNTOOLS%
2726
call "%VSTOOLS%..\..\VC\vcvarsall.bat" %_ARGS%

PCbuild/find_msbuild.bat

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,6 @@
3939
@if defined MSBUILD @if exist %MSBUILD% (set _Py_MSBuild_Source=Visual Studio installation) & goto :found
4040
:skip_vswhere
4141

42-
@rem VS 2015 and earlier register MSBuild separately, so we can find it.
43-
@reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath /reg:32 >nul 2>nul
44-
@if NOT ERRORLEVEL 1 @for /F "tokens=1,2*" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath /reg:32') DO @(
45-
@if "%%i"=="MSBuildToolsPath" @if exist "%%k\msbuild.exe" @(set MSBUILD="%%k\msbuild.exe")
46-
)
47-
@if exist %MSBUILD% (set _Py_MSBuild_Source=registry) & goto :found
48-
49-
50-
@exit /b 1
51-
5242
:found
5343
@pushd %MSBUILD% >nul 2>nul
5444
@if not ERRORLEVEL 1 @(

PCbuild/get_externals.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if "%ORG%"=="" (set ORG=python)
4545
call "%PCBUILD%\find_python.bat" "%PYTHON%"
4646

4747
if NOT DEFINED PYTHON (
48-
where /Q git || echo Python 3.6 could not be found or installed, and git.exe is not on your PATH && exit /B 1
48+
where /Q git || echo Python 3.10 or later could not be found or installed, and git.exe is not on your PATH && exit /B 1
4949
)
5050

5151
echo.Fetching external libraries...

PCbuild/python.props

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,14 @@
66
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
77
<!--
88
Use the latest available version of Visual Studio to build. To override
9-
this and build with an earlier version, pass "/p:PlatformToolset=v100"
9+
this and build with an earlier version, pass "/p:PlatformToolset=v141"
1010
(for example) when building.
1111
1212
We set BasePlatformToolset for ICC's benefit, it's otherwise ignored.
1313
-->
1414
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VisualStudioVersion)' == '17.0'">v143</BasePlatformToolset>
1515
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VisualStudioVersion)' == '16.0'">v142</BasePlatformToolset>
1616
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and ('$(MSBuildToolsVersion)' == '15.0' or '$(VisualStudioVersion)' == '15.0')">v141</BasePlatformToolset>
17-
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath14)' != ''">v140</BasePlatformToolset>
18-
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath12)' != ''">v120</BasePlatformToolset>
19-
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath11)' != ''">v110</BasePlatformToolset>
20-
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath10)' != ''">v100</BasePlatformToolset>
2117

2218
<PlatformToolset Condition="'$(PlatformToolset)' == ''">$(BasePlatformToolset)</PlatformToolset>
2319
<ICCBuild>false</ICCBuild>

PCbuild/pythoncore.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@
738738
</ClCompile>
739739
</ItemGroup>
740740
</Target>
741-
<Target Name="_WarnAboutToolset" BeforeTargets="PrepareForBuild" Condition="$(PlatformToolset) != 'v140' and $(PlatformToolset) != 'v141' and $(PlatformToolset) != 'v142' and $(PlatformToolset) != 'v143'">
741+
<Target Name="_WarnAboutToolset" BeforeTargets="PrepareForBuild" Condition="$(PlatformToolset) != 'v141' and $(PlatformToolset) != 'v142' and $(PlatformToolset) != 'v143'">
742742
<Warning Text="Toolset $(PlatformToolset) is not used for official builds. Your build may have errors or incompatibilities." />
743743
</Target>
744744
<Target Name="_WarnAboutZlib" BeforeTargets="PrepareForBuild" Condition="!$(IncludeExternals)">

PCbuild/readme.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Quick Start Guide
33

44
1. Install Microsoft Visual Studio 2017 or later with Python workload and
55
Python native development component.
6-
1a. Optionally install Python 3.6 or later. If not installed,
6+
1a. Optionally install Python 3.10 or later. If not installed,
77
get_externals.bat (via build.bat) will download and use Python via
88
NuGet.
99
2. Run "build.bat" to build Python in 32-bit Release configuration.
@@ -57,7 +57,7 @@ Building Python using the build.bat script
5757

5858
In this directory you can find build.bat, a script designed to make
5959
building Python on Windows simpler. This script will use the env.bat
60-
script to detect either Visual Studio 2017 or 2015, either of
60+
script to detect either Visual Studio 2017 or later, either of
6161
which may be used to build Python. Currently Visual Studio 2017 is
6262
officially supported.
6363

@@ -172,7 +172,7 @@ _lzma
172172
Homepage:
173173
https://tukaani.org/xz/
174174
_ssl
175-
Python wrapper for version 3.0 of the OpenSSL secure sockets
175+
Python wrapper for version 3.0.15 of the OpenSSL secure sockets
176176
library, which is downloaded from our binaries repository at
177177
https://github.com/python/cpython-bin-deps.
178178

@@ -195,7 +195,7 @@ _sqlite3
195195
Homepage:
196196
https://www.sqlite.org/
197197
_tkinter
198-
Wraps version 8.6.6 of the Tk windowing system, which is downloaded
198+
Wraps version 8.6.14 of the Tk windowing system, which is downloaded
199199
from our binaries repository at
200200
https://github.com/python/cpython-bin-deps.
201201

PCbuild/tcltk.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
<BuildDirTop Condition="$(Configuration) == 'Debug'">Debug</BuildDirTop>
3838
<BuildDirTop Condition="$(TclMachine) != 'IX86'">$(BuildDirTop)_$(TclMachine)</BuildDirTop>
3939
<BuildDirTop Condition="$(PlatformToolset.StartsWith('v14'))">$(BuildDirTop)_VC13</BuildDirTop>
40-
<BuildDirTop Condition="$(PlatformToolset) == 'v120'">$(BuildDirTop)_VC12</BuildDirTop>
41-
<BuildDirTop Condition="$(PlatformToolset) == 'v110'">$(BuildDirTop)_VC11</BuildDirTop>
42-
<BuildDirTop Condition="$(PlatformToolset) == 'v100'">$(BuildDirTop)_VC10</BuildDirTop>
4340
</PropertyGroup>
4441

4542
<!--

Tools/msi/README.txt

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ script:
99
For an official release, the installer should be built with the
1010
Tools/msi/buildrelease.bat script and environment variables:
1111

12-
set PYTHON=<path to Python 3.8 or later>
12+
set PYTHON=<path to Python 3.10 or later>
1313
set SPHINXBUILD=<path to sphinx-build.exe>
1414
set PATH=<path to Git (git.exe)>;%PATH%
1515

@@ -66,19 +66,13 @@ Tools\msi\get_externals.bat. (Note that this is in addition to the
6666
similarly named file in PCbuild.)
6767

6868
One of the dependencies used in builds is WiX, a toolset that lets developers
69-
create installers for Windows Installer, the Windows installation engine. WiX
70-
has a dependency on the Microsoft .NET Framework Version 3.5 (which may not be
71-
configured on recent versions of Windows, such as Windows 10). If you are
72-
building on a recent Windows version, use the Control Panel (Programs | Programs
73-
and Features | Turn Windows Features on or off) and ensure that the entry
74-
".NET Framework 3.5 (includes .NET 2.0 and 3.0)" is enabled.
75-
76-
For Python 3.11.x and above, enable "Microsoft .NET Framework 4.8 Advanced Services"
77-
instead of "Microsoft .NET Framework Version 3.5" available for Windows 10 and above.
78-
Also make sure "MSVC v143 - VS 2022 C++ ARM64 build tools" are selected under
79-
"Desktop Development with C++" in "Visual Studio installer" even if you are not
80-
building on ARM64 along with other x64 related v143 build tools. This is because for
81-
3.11.x and above we have upgraded to Wix-3.14.
69+
create installers for Windows Installer, the Windows installation engine.
70+
71+
Additionally, make sure "MSVC v14x - VS 20xx C++ ARM64 build tools" are
72+
selected under "Desktop Development with C++" in "Visual Studio installer",
73+
even if you are not building on ARM64. This is required because we have
74+
upgraded to WiX-3.14, which requires these tools for Python 3.11 and later
75+
versions.
8276

8377
For testing, the installer should be built with the Tools/msi/build.bat
8478
script:
@@ -107,7 +101,7 @@ be available alongside. This takes longer, but is easier to share.
107101
For an official release, the installer should be built with the
108102
Tools/msi/buildrelease.bat script:
109103

110-
set PYTHON=<path to Python 2.7 or 3.4>
104+
set PYTHON=<path to Python 3.10 or later>
111105
set SPHINXBUILD=<path to sphinx-build.exe>
112106
set PATH=<path to Git (git.exe)>;%PATH%
113107

Tools/msi/bundle/bootstrap/pythonba.vcxproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
2525
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
2626
<PlatformToolset Condition="'$(PlatformToolset)' == '' and ('$(MSBuildToolsVersion)' == '15.0' or '$(VisualStudioVersion)' == '15.0')">v141</PlatformToolset>
27-
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v140</PlatformToolset>
2827
<ProjectGuid>{7A09B132-B3EE-499B-A700-A4B2157FEA3D}</ProjectGuid>
2928
<TargetName>PythonBA</TargetName>
3029
</PropertyGroup>
@@ -51,8 +50,6 @@
5150
<Link>
5251
<AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;wininet.lib;dutil.lib;balutil.lib;version.lib;uxtheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
5352
<AdditionalLibraryDirectories Condition="$(PlatformToolset.StartsWith(`v14`))">$(WixInstallPath)sdk\vs2017\lib\x86</AdditionalLibraryDirectories>
54-
<AdditionalLibraryDirectories Condition="'$(PlatformToolset)' == 'v140'">$(WixInstallPath)sdk\vs2015\lib\x86</AdditionalLibraryDirectories>
55-
<AdditionalLibraryDirectories Condition="'$(PlatformToolset)' == 'v120'">$(WixInstallPath)sdk\vs2013\lib\x86</AdditionalLibraryDirectories>
5653
<ModuleDefinitionFile>pythonba.def</ModuleDefinitionFile>
5754
<GenerateDebugInformation Condition="'$(Configuration)'=='Debug'">true</GenerateDebugInformation>
5855
</Link>

0 commit comments

Comments
 (0)