Title: Error MSB4086 (numeric comparison)
Type: compile error Stage: resolved
Components: Windows Versions: Python 3.8
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: paul.moore, steve.dower, tim.golden, veganaiZe, zach.ware
Priority: normal Keywords:

Created on 2020-05-14 23:25 by veganaiZe, last changed 2020-05-18 10:18 by steve.dower. This issue is now closed.

File name Uploaded Description Edit
clean_out.txt veganaiZe, 2020-05-14 23:25 Output (-vv)
Messages (5)
msg368877 - (view) Author: (veganaiZe) * Date: 2020-05-14 23:25
I'm getting an "error MSB4086: A numeric comparison was attempted ..." while attempting to build Python 3.8.3 (branch `3.8` from github) on Windows 8.1 (64-bit) with VC++ Build Tools 14.0 (2015 R3), at the command line.

I'm guessing that I might have an incorrect (ie. too old) version of the .NET tools?

I've attach the `PCBuild\clean.bat -vv` output.

I can provide many more details but I didn't want to overwhelm.
msg369026 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2020-05-16 09:24
Haven't looked at your logs yet (on my phone), but make sure you have as recent an install of the Windows SDK as you can handle. That's typically what our build files check version numbers on.
msg369137 - (view) Author: (veganaiZe) * Date: 2020-05-17 16:30
Using Windows 10 SDK (from late 2019).  It's essential for the 2015r3 tools (since the build tools don't include the standard lib headers! --Gimme a break Microsoft!)

Here's the TL;DR from the log:

     2>Building with tools version "4.0".
     2>C:\src\cpython\PCbuild\python.props(111,31): error MSB4086: A numeric comparison was attempted on "$([System.Version]::Parse($(_RegistryVersion)))" that evaluates to "10.0.18362.0" instead of a number, in condition "$([System.Version]::Parse($(_RegistryVersion))) > $([System.Version]::Parse($(DefaultWindowsSDKVersion)))". [C:\src\cpython\PCbuild\_freeze_importlib.vcxproj]
msg369175 - (view) Author: (veganaiZe) * Date: 2020-05-18 04:37
Probably a result of pulling in `msbuild` from .net 4.0 tools.

I'm setting up a dedicated virtual machine.
msg369201 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2020-05-18 10:18
Yeah, that looks like a version of .NET that pre-dates Version being made comparable, which probably means you're not getting the MSBuild installed with VS.

Check out "where MSBuild" or %MSBUILD% to see if there's something obvious overriding it, and use the MSBUILD variable to override it yourself if necessary.

Good luck! Would love to hear if you find an approach that doesn't involve just setting up a whole machine!
Date User Action Args
2020-05-18 10:18:08steve.dowersetmessages: + msg369201
2020-05-18 04:37:03veganaiZesetstatus: open -> closed
resolution: not a bug
messages: + msg369175

stage: resolved
2020-05-17 16:30:21veganaiZesetmessages: + msg369137
2020-05-16 09:24:03steve.dowersetmessages: + msg369026
2020-05-14 23:25:06veganaiZecreate