classification
Title: Windows build cannot detect missing Windows SDK
Type: compile error Stage:
Components: Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: White1, Zack_Barton, mytechnotalent, steve.dower
Priority: normal Keywords:

Created on 2021-02-22 17:25 by mytechnotalent, last changed 2021-02-23 12:05 by mytechnotalent.

Messages (5)
msg387518 - (view) Author: Kevin Thomas (mytechnotalent) Date: 2021-02-22 17:25
When compiling for Windows it does not properly handle the version string MSB4184

C:\Users\kevin\cpython>PCbuild\build.bat
Using py -3.7 (found 3.7 with py.exe)
Fetching external libraries...
bzip2-1.0.6 already exists, skipping.
sqlite-3.34.0.0 already exists, skipping.
xz-5.2.2 already exists, skipping.
zlib-1.2.11 already exists, skipping.
Fetching external binaries...
libffi already exists, skipping.
openssl-bin-1.1.1i already exists, skipping.
tcltk-8.6.10.0 already exists, skipping.
Finished.
Using "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" (found in the Visual Studio installation)

C:\Users\kevin\cpython>"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" "C:\Users\kevin\cpython\PCbuild\pcbuild.proj" /t:Build /m /nologo /v:m /clp:summary /p:Configuration=Release /p:Platform=x64 /p:IncludeExternals=true /p:IncludeCTypes=true /p:IncludeSSL=true /p:IncludeTkinter=true /p:UseTestMarker= /p:GIT="C:\Program Files\Git\cmd\git.exe"
C:\Users\kevin\cpython\PCbuild\python.props(111,31): error MSB4184: The expression "[System.Version]::Parse('')" cannot
 be evaluated. Version string portion was too short or too long. [C:\Users\kevin\cpython\PCbuild\pythoncore.vcxproj]

Build FAILED.

C:\Users\kevin\cpython\PCbuild\python.props(111,31): error MSB4184: The expression "[System.Version]::Parse('')" cannot
 be evaluated. Version string portion was too short or too long. [C:\Users\kevin\cpython\PCbuild\pythoncore.vcxproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.06
msg387529 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-22 18:49
This should mean that you haven't got the Windows SDK installed, though it might mean that you've got a *newer* WinSDK where they've changed the registration format.

But more likely you deselected it when installing C++ support through Visual Studio. Could you open Visual Studio Installer and ensure that the newest Windows SDK item is selected?

Assuming the spammers go away, we can use this bug to improve the error message. If they persist, we'll lock this and open a new one.
msg387533 - (view) Author: Kevin Thomas (mytechnotalent) Date: 2021-02-22 19:03
Thank you Steve.  I did not have the latest installed which is Win10SDK_10.0.18362, therefore it did trigger that original error in msg387518.

After installing, Win10SDK_10.0.18362, it did in-fact allow a successful compilation.

Updating that error code would be most helpful to Windows developers.  I would have never caught it but I wanted to help test 3.10 so I thought I should try it on the Windows 10 box to make sure the community had all platforms covered.

RESULTS:
Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:01:10.34

C:\Users\kevin\cpython>python.bat
Running Release|x64 interpreter...
Python 3.10.0a5+ (heads/master:91a639a094, Feb 22 2021, 14:01:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
msg387561 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-23 11:15
> I did not have the latest installed which is Win10SDK_10.0.18362, therefore it did trigger that original error in msg387518.

Did you have any other version installed? It should include one by 
default, which is why we don't mention it in the quick instructions, but 
I think you can remove it at install time.
msg387563 - (view) Author: Kevin Thomas (mytechnotalent) Date: 2021-02-23 12:05
Hi Steve actually there was none installed which was strange as I had Visual Studio installed but it was not checked by default.  After selecting it and installing it, everything works as expected.  Updating the error message in some way might be helpful.
History
Date User Action Args
2021-02-23 12:05:55mytechnotalentsetmessages: + msg387563
2021-02-23 11:15:45steve.dowersetmessages: + msg387561
2021-02-22 19:06:19eryksunsetmessages: - msg387525
2021-02-22 19:06:16eryksunsetmessages: - msg387522
2021-02-22 19:06:11eryksunsetmessages: - msg387521
2021-02-22 19:03:14mytechnotalentsetmessages: + msg387533
2021-02-22 18:49:02steve.dowersetmessages: + msg387529
title: Windows build issue -> Windows build cannot detect missing Windows SDK
2021-02-22 18:26:03White1setmessages: + msg387525
2021-02-22 18:12:10White1setnosy: + White1
messages: + msg387522
2021-02-22 17:57:26Zack_Bartonsetnosy: + Zack_Barton
messages: + msg387521
2021-02-22 17:27:04vstinnersetnosy: + steve.dower
2021-02-22 17:25:51mytechnotalentcreate