Re: Compile from source using latest Microsoft Windows SDK - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Compile from source using latest Microsoft Windows SDK
Date
Msg-id 20190718080914.GH1416@paquier.xyz
Whole thread Raw
In response to Compile from source using latest Microsoft Windows SDK  (Peifeng Qiu <pqiu@pivotal.io>)
Responses Re: Compile from source using latest Microsoft Windows SDK  (Peifeng Qiu <pqiu@pivotal.io>)
List pgsql-hackers
Hi Peifeng,

On Fri, Mar 29, 2019 at 12:01:26AM +0900, Peifeng Qiu wrote:
> The current Windows build system supports compiling with Windows SDK up to
> v8.1. When building with the latest Windows SDK v10 which is the default
> for Visual Studio 2017, we will get the following error:
>
> error MSB8036: The Windows SDK version 8.1 was not found.

Actually up to 10, no?  Sorry for the delay, I have just noticed this
patch registered in the commit fest.  And now is review time.

> When the build system generates projects files for MSBuild to consume, it
> doesn't include a SDK version number. Then MSBuild will assume v8.1 as
> default.
> But if we only install the latest v10 but not v8.1, MSBuild will error out.

So...  This actually boils down to that behavior:

https://developercommunity.visualstudio.com/content/problem/140294/windowstargetplatformversion-makes-it-impossible-t.html

While WindowsSDKVersion seems to be present all the time.  I think
that we should be more defensive if the variable is not defined, and
instead rely on the default provided by the system, whatever it may
be.  In short it seems to me that the tag WindowsTargetPlatformVersion
should be added only if the variable exists, and your patch always
sets it.

For anything with Postgres on Windows, I have been using Visual Studio
2015 and 2019 lately to compile Postgres mainly with the Native Tools
command prompt so I have never actually faced this failure even with
the most recent VS 2019.  Using just a command prompt causes a failure
when finding out nmake for example as that's not in the default PATH.
Our buildfarm members don't complain either, and there are two animals
using VS 2017: hamerkop and bowerbird.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: refactoring - share str2*int64 functions
Next
From: Ning Yu
Date:
Subject: Possible race condition in pg_mkdir_p()?