Re: BUG #15889: PostgreSQL failed to build due to error MSB8020 withMSVC on windows

Поиск
Список
Период
Сортировка
От Haribabu Kommi
Тема Re: BUG #15889: PostgreSQL failed to build due to error MSB8020 withMSVC on windows
Дата
Msg-id CAJrrPGeKQMmT9ScVGmuo6u9PPobmO4G4kc9mLcARu+qZoGyFtg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #15889: PostgreSQL failed to build due to error MSB8020 withMSVC on windows  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-bugs

On Wed, 3 Jul 2019 at 21:35, Michael Paquier <michael@paquier.xyz> wrote:
(Adding Hari who has helped with this work.)

On Wed, Jul 03, 2019 at 09:10:34AM +0000, PG Bug reporting form wrote:
> PostgreSQL failed to build due to error MSB8020: The build tools for v142
> (Platform Toolset = 'v142') cannot be found with MSVC on windows.  It can be
> first reproduced on master branch 2b1394fc2b52a2573d08aa626e7b49568f27464e
> reversion which is 'Add support for Visual Studio 2019 in build scripts'.
>
> Further investigation we found that VS2017 does not seem to be supported in
> this commit. We mainly use open source projects to test VS compilers.
> Currently we are using VS2017 and there is no plan to migrate to VS2019.
> Could you please help look at this issue and provide a work around to us to
> solve this issue? Thanks a lot!

Mumble.  VS 2017 should be supported in our builds.

It happens that we do have a buildfarm member called bowerbird which
uses Visual Studio 2017, and this is not complaining at all:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=bowerbird&dt=2019-07-02%2018%3A30%3A56

So at first sight the logic we have does not seem that wrong because
it has already tested the commit which adds VS 2019 :)

During the development of this patch, I tested various combinations with both VS 2017 and
VS 2019 and didn't find any problems.

 
> Failures:
> C:\Program Files (x86)\Microsoft Visual
> Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(57,5):
> error MSB8020: The build tools for v142 (Platform Toolset = 'v142') cannot
> be found. To build using the v142 build tools, please install v142 build
> tools.  Alternatively, you may upgrade to the current Visual Studio tools by
> selecting the Project menu or right-click the solution, and then selecting
> "Retarget solution". [D:\PostgreSQL\src\postgres.vcxproj]

Looking at the code, it looks to be an effect of the version checking
in CreateProject()/MSBuildProject.pm, causing a VC2019Project object
to be generated instead of a VC2017Project one.  Your scripts seem to
be rather advanced, and I have little idea how your installation looks
like.  What's the return result of DetermineVisualStudioVersion()?
With VS 2017, the result is assumed to be between 14.10 and 14.20 as
far as I know.  You can also know that by looking at the version of
nmake shipped with your installation using the native tool terminal
for example.  I guess that in your case the version of nmake is
between 14.20.XX.YY and 15.00.NN.PP?

I feel the reason for failure may be the project files are generated with VS 2019
first and later try to use the same project files with VS 2017?

May be reporter can clarify it.

Regards,
Haribabu Kommi

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: PG11 - Multiple Key Range Partition
Следующее
От: Etsuro Fujita
Дата:
Сообщение: Re: FDW does not push down LIMIT & ORDER BY with sharding (partitions)