Re: Compile from source using latest Microsoft Windows SDK

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peifeng Qiu <pqiu(at)pivotal(dot)io>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Compile from source using latest Microsoft Windows SDK
Date: 2019-07-18 08:09:14
Message-ID: 20190718080914.GH1416@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ning Yu 2019-07-18 08:17:22 Possible race condition in pg_mkdir_p()?
Previous Message Fabien COELHO 2019-07-18 07:57:41 Re: refactoring - share str2*int64 functions