Обсуждение: Windows build patch

Поиск
Список
Период
Сортировка

Windows build patch

От
Wim Dumon
Дата:
I noticed that the msvs makefile doesn't work. One file is missing, and the manifest embedding test is a bit awkward. The attached patch fixes these issues.

BR,
Wim.

Вложения

Re: Windows build patch

От
Craig Ringer
Дата:
On 11/19/2013 05:36 PM, Wim Dumon wrote:
> Referring to the instructions located here:
> http://www.postgresql.org/docs/8.3/static/install-win32-libpq.html

Are you in fact trying to build 8.3? Or the current version? You linked
to the 8.3 docs, but the patch filename suggests it's against 9.3.1.

In general patches should be against current git master.

It'd be good if you could provide some accompanying detail. What SDK or
Visual Studio are you using? On what OS and version? Exactly what build
steps did you take to encounter the error you report, and what is the
exact text of the error?

Such details will help others find out about an issue by searching
later, and they'll help focus testing of any patch.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



Re: Windows build patch

От
Wim Dumon
Дата:
9.3.1 is the version that failed for me, MSVS 2012, Windows 7.
Build commands:
cd src
nmake /f win32.mak

The first build error:

        link.exe -lib @C:\Users\wim\AppData\Local\Temp\nmB317.tmp
        rc.exe /l 0x409 /fo".\Release\libpq.res" libpq-dist.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.2.9200.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

        link.exe @C:\Users\wim\AppData\Local\Temp\nmB3A5.tmp
   Creating library .\Release\libpqdll.lib and object .\Release\libpqdll.exp
libpq.lib(dirmod.obj) : error LNK2019: unresolved external symbol _pstrdup referenced in function _pgfnames
libpq.lib(dirmod.obj) : error LNK2019: unresolved external symbol _palloc referenced in function _pgfnames
libpq.lib(dirmod.obj) : error LNK2019: unresolved external symbol _pfree referenced in function _pgfnames_cleanup
libpq.lib(dirmod.obj) : error LNK2019: unresolved external symbol _repalloc referenced in function _pgfnames
.\Release\libpq.dll : fatal error LNK1120: 4 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\link.exe"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\nmake.EXE"' : return code '0x2'
Stop.



The second build error, after adding the missing .c file:

   Creating library .\Release\libpqdll.lib and object .\Release\libpqdll.exp
        mt -manifest .\Release\libpq.dll.manifest -outputresource:.\Release\libpq.dll;2
Microsoft (R) Manifest Tool version 6.2.9200.16384
Copyright (c) Microsoft Corporation 2012.
All rights reserved.

.\Release\libpq.dll.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Windows Kits\8.0\bin\x86\mt.EXE"' : return code '0x1f'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\nmake.EXE"' : return code '0x2'
Stop.



2013/11/19 Craig Ringer <craig@2ndquadrant.com>
On 11/19/2013 05:36 PM, Wim Dumon wrote:
> Referring to the instructions located here:
> http://www.postgresql.org/docs/8.3/static/install-win32-libpq.html

Are you in fact trying to build 8.3? Or the current version? You linked
to the 8.3 docs, but the patch filename suggests it's against 9.3.1.

In general patches should be against current git master.

It'd be good if you could provide some accompanying detail. What SDK or
Visual Studio are you using? On what OS and version? Exactly what build
steps did you take to encounter the error you report, and what is the
exact text of the error?

Such details will help others find out about an issue by searching
later, and they'll help focus testing of any patch.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Re: Windows build patch

От
Craig Ringer
Дата:
On 11/19/2013 06:55 PM, Wim Dumon wrote:
> 9.3.1 is the version that failed for me, MSVS 2012, Windows 7.
> Build commands:
> cd src
> nmake /f win32.mak

OK, so you're trying to build libpq (and just libpq, not the rest of
PostgreSQL) using the standalone makefile, instead of using build.pl to
compile the whole tree.

That's supposed to be supported, but I won't be too surprised if it's
bit-rotted a bit. Your patch makes sense in this context. You add a
missing soure file, and you only process the DLL manifest if one is
generated. That seems reasonable. I'd like to test this patch out
quickly, but I'm fairly happy with it.

BTW, the well maintained procedure is for a full source build, per,
http://www.postgresql.org/docs/current/static/install-windows.html . We
should still fix standalone builds of libpq, but in general I tend to
just build the whole tree.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



Re: Windows build patch

От
Alvaro Herrera
Дата:
Wim Dumon wrote:
> 9.3.1 is the version that failed for me, MSVS 2012, Windows 7.

It's pretty clear that we will never be able to keep this working unless
somebody sets up a buildfarm animal that tests this stuff directly.
If you're up to the task, please see here:
https://wiki.postgresql.org/wiki/PostgreSQL_Buildfarm_Howto

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services