summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-06-20 20:12:46 (GMT)
committerGitHub <noreply@github.com>2021-06-20 20:12:46 (GMT)
commit5fbccb763ce540c0d07be86660e0357bffc69d76 (patch)
tree41824017cc63ada343200dbf9550732f5190a50c
parent8673b77e251e42874501a47b1df86c6bde4fe1d2 (diff)
downloadcpython-5fbccb763ce540c0d07be86660e0357bffc69d76.zip
cpython-5fbccb763ce540c0d07be86660e0357bffc69d76.tar.gz
cpython-5fbccb763ce540c0d07be86660e0357bffc69d76.tar.bz2
bpo-43298: Improved error message when building without the Windows SDK installed (GH-26800) (GH-26802)
(cherry picked from commit 80190b3e533097b55077becddc75423318ab2371) Co-authored-by: Steve Dower <steve.dower@python.org> Co-authored-by: Steve Dower <steve.dower@python.org>
-rw-r--r--Misc/NEWS.d/next/Build/2021-06-19-11-50-03.bpo-43298.9ircMb.rst1
-rw-r--r--PCbuild/python.props15
2 files changed, 13 insertions, 3 deletions
diff --git a/Misc/NEWS.d/next/Build/2021-06-19-11-50-03.bpo-43298.9ircMb.rst b/Misc/NEWS.d/next/Build/2021-06-19-11-50-03.bpo-43298.9ircMb.rst
new file mode 100644
index 0000000..3bdc24b
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2021-06-19-11-50-03.bpo-43298.9ircMb.rst
@@ -0,0 +1 @@
+Improved error message when building without a Windows SDK installed.
diff --git a/PCbuild/python.props b/PCbuild/python.props
index 419d5eb..4a56d50 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -108,9 +108,18 @@
<!-- The minimum allowed SDK version to use for building -->
<DefaultWindowsSDKVersion>10.0.10586.0</DefaultWindowsSDKVersion>
- <DefaultWindowsSDKVersion Condition="$([System.Version]::Parse($(_RegistryVersion))) > $([System.Version]::Parse($(DefaultWindowsSDKVersion)))">$(_RegistryVersion)</DefaultWindowsSDKVersion>
+ <DefaultWindowsSDKVersion Condition="$(_RegistryVersion) != '' and $([System.Version]::Parse($(_RegistryVersion))) > $([System.Version]::Parse($(DefaultWindowsSDKVersion)))">$(_RegistryVersion)</DefaultWindowsSDKVersion>
</PropertyGroup>
-
+
+ <Target Name="_CheckWindowsSDKFound" BeforeTargets="_CheckWindowsSDKInstalled" Condition="$(_RegistryVersion) == ''">
+ <PropertyGroup>
+ <_Message>Failed to locate a Windows SDK installation.</_Message>
+ <_Message>$(_Message) If the build fails, please use the Visual Studio Installer to install the Windows SDK.</_Message>
+ <_Message>$(_Message) (Ignore the version number specified in the error message and select the latest.)</_Message>
+ </PropertyGroup>
+ <Warning Text="$(_Message)" />
+ </Target>
+
<PropertyGroup Condition="$(WindowsTargetPlatformVersion) == ''">
<WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
</PropertyGroup>
@@ -175,7 +184,7 @@
<ReleaseLevelNumber Condition="$(_ReleaseLevel) == 'b'">11</ReleaseLevelNumber>
<ReleaseLevelNumber Condition="$(_ReleaseLevel) == 'rc'">12</ReleaseLevelNumber>
</PropertyGroup>
-
+
<PropertyGroup>
<PythonVersionNumber>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</PythonVersionNumber>
<PythonVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)$(ReleaseLevelName)</PythonVersion>