Re: Windows build patch

Lists: pgsql-hackers
From: Wim Dumon <wim(at)emweb(dot)be>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Windows build patch
Date: 2013-11-19 09:36:22
Message-ID: CAJ2=PVQA14fVydJ=-7GMQ8Bem6ZjfmeDpmu9U6agFTFkDW85HQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Referring to the instructions located here:
http://www.postgresql.org/docs/8.3/static/install-win32-libpq.html

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.

Attachment Content-Type Size
postgresql-9.3.1.patch application/octet-stream 1.6 KB

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Wim Dumon <wim(at)emweb(dot)be>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Windows build patch
Date: 2013-11-19 10:30:01
Message-ID: 528B3DA9.2080808@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Wim Dumon <wim(at)emweb(dot)be>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Windows build patch
Date: 2013-11-19 10:55:32
Message-ID: CAJ2=PVQcW8UGNnSy=Ow=vUK2zpjowTkzUS1B864REa7LOT140Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(at)2ndquadrant(dot)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
>


From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Wim Dumon <wim(at)emweb(dot)be>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Windows build patch
Date: 2013-11-19 12:03:11
Message-ID: 528B537F.3070401@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Wim Dumon <wim(at)emweb(dot)be>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Windows build patch
Date: 2014-03-18 20:50:39
Message-ID: 20140318205039.GB6899@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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