gh-124102: Update internal PCbuild docs to accurately list build dependencies (GH-124103)

This commit is contained in:
Wulian 2024-09-24 07:09:22 +08:00 committed by GitHub
parent 8a2baedc4b
commit 27a62e7371
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 23 additions and 48 deletions

View File

@ -0,0 +1,2 @@
Update internal documentation under PCbuild, so it now correctly states that
Windows requires VS2017 or later and Python 3.10 or later

View File

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

View File

@ -4,8 +4,8 @@ rem command window. However, most builds of Python will ignore the version
rem of the tools on PATH and use PlatformToolset instead. Ideally, both sets of rem of the tools on PATH and use PlatformToolset instead. Ideally, both sets of
rem tools should be the same version to avoid potential conflicts. rem tools should be the same version to avoid potential conflicts.
rem rem
rem To build Python with an earlier toolset, pass "/p:PlatformToolset=v100" (or rem To build Python with an earlier toolset, pass "/p:PlatformToolset=v141" (or
rem 'v110', 'v120' or 'v140') to the build script. rem 'v142', 'v143') to the build script.
echo Build environments: x86, amd64, x86_amd64 echo Build environments: x86, amd64, x86_amd64
echo. echo.
@ -20,8 +20,7 @@ call "%VSTOOLS%" %_ARGS%
exit /B 0 exit /B 0
:skip_vswhere :skip_vswhere
if not defined VSTOOLS set VSTOOLS=%VS140COMNTOOLS% if not defined VSTOOLS set VSTOOLS=%VS143COMNTOOLS%
if not defined VSTOOLS set VSTOOLS=%VS120COMNTOOLS% if not defined VSTOOLS set VSTOOLS=%VS142COMNTOOLS%
if not defined VSTOOLS set VSTOOLS=%VS110COMNTOOLS% if not defined VSTOOLS set VSTOOLS=%VS141COMNTOOLS%
if not defined VSTOOLS set VSTOOLS=%VS100COMNTOOLS%
call "%VSTOOLS%..\..\VC\vcvarsall.bat" %_ARGS% call "%VSTOOLS%..\..\VC\vcvarsall.bat" %_ARGS%

View File

@ -39,16 +39,6 @@
@if defined MSBUILD @if exist %MSBUILD% (set _Py_MSBuild_Source=Visual Studio installation) & goto :found @if defined MSBUILD @if exist %MSBUILD% (set _Py_MSBuild_Source=Visual Studio installation) & goto :found
:skip_vswhere :skip_vswhere
@rem VS 2015 and earlier register MSBuild separately, so we can find it.
@reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath /reg:32 >nul 2>nul
@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 @(
@if "%%i"=="MSBuildToolsPath" @if exist "%%k\msbuild.exe" @(set MSBUILD="%%k\msbuild.exe")
)
@if exist %MSBUILD% (set _Py_MSBuild_Source=registry) & goto :found
@exit /b 1
:found :found
@pushd %MSBUILD% >nul 2>nul @pushd %MSBUILD% >nul 2>nul
@if not ERRORLEVEL 1 @( @if not ERRORLEVEL 1 @(

View File

@ -45,7 +45,7 @@ if "%ORG%"=="" (set ORG=python)
call "%PCBUILD%\find_python.bat" "%PYTHON%" call "%PCBUILD%\find_python.bat" "%PYTHON%"
if NOT DEFINED PYTHON ( if NOT DEFINED PYTHON (
where /Q git || echo Python 3.6 could not be found or installed, and git.exe is not on your PATH && exit /B 1 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
) )
echo.Fetching external libraries... echo.Fetching external libraries...

View File

@ -6,7 +6,7 @@
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration> <Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<!-- <!--
Use the latest available version of Visual Studio to build. To override Use the latest available version of Visual Studio to build. To override
this and build with an earlier version, pass "/p:PlatformToolset=v100" this and build with an earlier version, pass "/p:PlatformToolset=v141"
(for example) when building. (for example) when building.
We set BasePlatformToolset for ICC's benefit, it's otherwise ignored. We set BasePlatformToolset for ICC's benefit, it's otherwise ignored.
@ -14,10 +14,6 @@
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VisualStudioVersion)' == '17.0'">v143</BasePlatformToolset> <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VisualStudioVersion)' == '17.0'">v143</BasePlatformToolset>
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VisualStudioVersion)' == '16.0'">v142</BasePlatformToolset> <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VisualStudioVersion)' == '16.0'">v142</BasePlatformToolset>
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and ('$(MSBuildToolsVersion)' == '15.0' or '$(VisualStudioVersion)' == '15.0')">v141</BasePlatformToolset> <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and ('$(MSBuildToolsVersion)' == '15.0' or '$(VisualStudioVersion)' == '15.0')">v141</BasePlatformToolset>
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath14)' != ''">v140</BasePlatformToolset>
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath12)' != ''">v120</BasePlatformToolset>
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath11)' != ''">v110</BasePlatformToolset>
<BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath10)' != ''">v100</BasePlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == ''">$(BasePlatformToolset)</PlatformToolset> <PlatformToolset Condition="'$(PlatformToolset)' == ''">$(BasePlatformToolset)</PlatformToolset>
<ICCBuild>false</ICCBuild> <ICCBuild>false</ICCBuild>

View File

@ -738,7 +738,7 @@
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
</Target> </Target>
<Target Name="_WarnAboutToolset" BeforeTargets="PrepareForBuild" Condition="$(PlatformToolset) != 'v140' and $(PlatformToolset) != 'v141' and $(PlatformToolset) != 'v142' and $(PlatformToolset) != 'v143'"> <Target Name="_WarnAboutToolset" BeforeTargets="PrepareForBuild" Condition="$(PlatformToolset) != 'v141' and $(PlatformToolset) != 'v142' and $(PlatformToolset) != 'v143'">
<Warning Text="Toolset $(PlatformToolset) is not used for official builds. Your build may have errors or incompatibilities." /> <Warning Text="Toolset $(PlatformToolset) is not used for official builds. Your build may have errors or incompatibilities." />
</Target> </Target>
<Target Name="_WarnAboutZlib" BeforeTargets="PrepareForBuild" Condition="!$(IncludeExternals)"> <Target Name="_WarnAboutZlib" BeforeTargets="PrepareForBuild" Condition="!$(IncludeExternals)">

View File

@ -3,7 +3,7 @@ Quick Start Guide
1. Install Microsoft Visual Studio 2017 or later with Python workload and 1. Install Microsoft Visual Studio 2017 or later with Python workload and
Python native development component. Python native development component.
1a. Optionally install Python 3.6 or later. If not installed, 1a. Optionally install Python 3.10 or later. If not installed,
get_externals.bat (via build.bat) will download and use Python via get_externals.bat (via build.bat) will download and use Python via
NuGet. NuGet.
2. Run "build.bat" to build Python in 32-bit Release configuration. 2. Run "build.bat" to build Python in 32-bit Release configuration.
@ -57,7 +57,7 @@ Building Python using the build.bat script
In this directory you can find build.bat, a script designed to make In this directory you can find build.bat, a script designed to make
building Python on Windows simpler. This script will use the env.bat building Python on Windows simpler. This script will use the env.bat
script to detect either Visual Studio 2017 or 2015, either of script to detect either Visual Studio 2017 or later, either of
which may be used to build Python. Currently Visual Studio 2017 is which may be used to build Python. Currently Visual Studio 2017 is
officially supported. officially supported.
@ -172,7 +172,7 @@ _lzma
Homepage: Homepage:
https://tukaani.org/xz/ https://tukaani.org/xz/
_ssl _ssl
Python wrapper for version 3.0 of the OpenSSL secure sockets Python wrapper for version 3.0.15 of the OpenSSL secure sockets
library, which is downloaded from our binaries repository at library, which is downloaded from our binaries repository at
https://github.com/python/cpython-bin-deps. https://github.com/python/cpython-bin-deps.
@ -195,7 +195,7 @@ _sqlite3
Homepage: Homepage:
https://www.sqlite.org/ https://www.sqlite.org/
_tkinter _tkinter
Wraps version 8.6.6 of the Tk windowing system, which is downloaded Wraps version 8.6.14 of the Tk windowing system, which is downloaded
from our binaries repository at from our binaries repository at
https://github.com/python/cpython-bin-deps. https://github.com/python/cpython-bin-deps.

View File

@ -37,9 +37,6 @@
<BuildDirTop Condition="$(Configuration) == 'Debug'">Debug</BuildDirTop> <BuildDirTop Condition="$(Configuration) == 'Debug'">Debug</BuildDirTop>
<BuildDirTop Condition="$(TclMachine) != 'IX86'">$(BuildDirTop)_$(TclMachine)</BuildDirTop> <BuildDirTop Condition="$(TclMachine) != 'IX86'">$(BuildDirTop)_$(TclMachine)</BuildDirTop>
<BuildDirTop Condition="$(PlatformToolset.StartsWith('v14'))">$(BuildDirTop)_VC13</BuildDirTop> <BuildDirTop Condition="$(PlatformToolset.StartsWith('v14'))">$(BuildDirTop)_VC13</BuildDirTop>
<BuildDirTop Condition="$(PlatformToolset) == 'v120'">$(BuildDirTop)_VC12</BuildDirTop>
<BuildDirTop Condition="$(PlatformToolset) == 'v110'">$(BuildDirTop)_VC11</BuildDirTop>
<BuildDirTop Condition="$(PlatformToolset) == 'v100'">$(BuildDirTop)_VC10</BuildDirTop>
</PropertyGroup> </PropertyGroup>
<!-- <!--

View File

@ -9,7 +9,7 @@ script:
For an official release, the installer should be built with the For an official release, the installer should be built with the
Tools/msi/buildrelease.bat script and environment variables: Tools/msi/buildrelease.bat script and environment variables:
set PYTHON=<path to Python 3.8 or later> set PYTHON=<path to Python 3.10 or later>
set SPHINXBUILD=<path to sphinx-build.exe> set SPHINXBUILD=<path to sphinx-build.exe>
set PATH=<path to Git (git.exe)>;%PATH% set PATH=<path to Git (git.exe)>;%PATH%
@ -66,19 +66,13 @@ Tools\msi\get_externals.bat. (Note that this is in addition to the
similarly named file in PCbuild.) similarly named file in PCbuild.)
One of the dependencies used in builds is WiX, a toolset that lets developers One of the dependencies used in builds is WiX, a toolset that lets developers
create installers for Windows Installer, the Windows installation engine. WiX create installers for Windows Installer, the Windows installation engine.
has a dependency on the Microsoft .NET Framework Version 3.5 (which may not be
configured on recent versions of Windows, such as Windows 10). If you are
building on a recent Windows version, use the Control Panel (Programs | Programs
and Features | Turn Windows Features on or off) and ensure that the entry
".NET Framework 3.5 (includes .NET 2.0 and 3.0)" is enabled.
For Python 3.11.x and above, enable "Microsoft .NET Framework 4.8 Advanced Services" Additionally, make sure "MSVC v14x - VS 20xx C++ ARM64 build tools" are
instead of "Microsoft .NET Framework Version 3.5" available for Windows 10 and above. selected under "Desktop Development with C++" in "Visual Studio installer",
Also make sure "MSVC v143 - VS 2022 C++ ARM64 build tools" are selected under even if you are not building on ARM64. This is required because we have
"Desktop Development with C++" in "Visual Studio installer" even if you are not upgraded to WiX-3.14, which requires these tools for Python 3.11 and later
building on ARM64 along with other x64 related v143 build tools. This is because for versions.
3.11.x and above we have upgraded to Wix-3.14.
For testing, the installer should be built with the Tools/msi/build.bat For testing, the installer should be built with the Tools/msi/build.bat
script: script:
@ -107,7 +101,7 @@ be available alongside. This takes longer, but is easier to share.
For an official release, the installer should be built with the For an official release, the installer should be built with the
Tools/msi/buildrelease.bat script: Tools/msi/buildrelease.bat script:
set PYTHON=<path to Python 2.7 or 3.4> set PYTHON=<path to Python 3.10 or later>
set SPHINXBUILD=<path to sphinx-build.exe> set SPHINXBUILD=<path to sphinx-build.exe>
set PATH=<path to Git (git.exe)>;%PATH% set PATH=<path to Git (git.exe)>;%PATH%

View File

@ -24,7 +24,6 @@
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == '' and ('$(MSBuildToolsVersion)' == '15.0' or '$(VisualStudioVersion)' == '15.0')">v141</PlatformToolset> <PlatformToolset Condition="'$(PlatformToolset)' == '' and ('$(MSBuildToolsVersion)' == '15.0' or '$(VisualStudioVersion)' == '15.0')">v141</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v140</PlatformToolset>
<ProjectGuid>{7A09B132-B3EE-499B-A700-A4B2157FEA3D}</ProjectGuid> <ProjectGuid>{7A09B132-B3EE-499B-A700-A4B2157FEA3D}</ProjectGuid>
<TargetName>PythonBA</TargetName> <TargetName>PythonBA</TargetName>
</PropertyGroup> </PropertyGroup>
@ -51,8 +50,6 @@
<Link> <Link>
<AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;wininet.lib;dutil.lib;balutil.lib;version.lib;uxtheme.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;wininet.lib;dutil.lib;balutil.lib;version.lib;uxtheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories Condition="$(PlatformToolset.StartsWith(`v14`))">$(WixInstallPath)sdk\vs2017\lib\x86</AdditionalLibraryDirectories> <AdditionalLibraryDirectories Condition="$(PlatformToolset.StartsWith(`v14`))">$(WixInstallPath)sdk\vs2017\lib\x86</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(PlatformToolset)' == 'v140'">$(WixInstallPath)sdk\vs2015\lib\x86</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(PlatformToolset)' == 'v120'">$(WixInstallPath)sdk\vs2013\lib\x86</AdditionalLibraryDirectories>
<ModuleDefinitionFile>pythonba.def</ModuleDefinitionFile> <ModuleDefinitionFile>pythonba.def</ModuleDefinitionFile>
<GenerateDebugInformation Condition="'$(Configuration)'=='Debug'">true</GenerateDebugInformation> <GenerateDebugInformation Condition="'$(Configuration)'=='Debug'">true</GenerateDebugInformation>
</Link> </Link>