Windows build issues

Started by Peter Eisentrautabout 15 years ago29 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

I was trying to build the Windows msvc build for the first time and ran
into some issues.

The documentation talks about obtaining and using the "Platform SDK". I
understand that this is nowadays called the "Windows SDK". Searching
for the former on the Microsoft download site doesn't offer anything
recent. If my understanding is correct, the documentation should be
updated.

The file src/tools/msvc/README contains some information that apparently
augments the build instructions in the main documentation. It talks
about Visual Studio 2005, which is probably outdated, and the section
"Notes about Visual Studio Express" talks about some files that my
installation doesn't contain, so probably also outdated. That last
section should probably be moved into the main documentation, if it's
still relevant.

Between the main documentation and that README, it also becomes less
clear whether the SDK or Visual Studio Express or both are needed.

Then the real issue. The build.pl tries to call "vcbuild", which
neither the SDK version 7.1 nor the Visual Studio Express 2010 contain
anywhere. (There is a vcbuild.dll, but that's it.) Some web searching
suggests that vcbuild.exe might have been renamed in the Visual Studio
2010 version. I don't see any buildfarm coverage of that version.

So is 2010 supported, and where is the vcbuild program supposed to come
from?

#2Andrew Dunstan
andrew@dunslane.net
In reply to: Peter Eisentraut (#1)
Re: Windows build issues

On 03/31/2011 03:38 PM, Peter Eisentraut wrote:

So is 2010 supported, and where is the vcbuild program supposed to come
from?

Not that I know of. But VS 2008 is, and should be readily available. In
fact, I recently made patches to allow it to to be used to build all the
live branches.

cheers

andrew

#3Dave Page
dpage@pgadmin.org
In reply to: Peter Eisentraut (#1)
Re: Windows build issues

No, 2010 is not yet supported, though I beleive some initial work was done.

I'm intending to work on it for 9.2.

On 3/31/11, Peter Eisentraut <peter_e@gmx.net> wrote:

I was trying to build the Windows msvc build for the first time and ran
into some issues.

The documentation talks about obtaining and using the "Platform SDK". I
understand that this is nowadays called the "Windows SDK". Searching
for the former on the Microsoft download site doesn't offer anything
recent. If my understanding is correct, the documentation should be
updated.

The file src/tools/msvc/README contains some information that apparently
augments the build instructions in the main documentation. It talks
about Visual Studio 2005, which is probably outdated, and the section
"Notes about Visual Studio Express" talks about some files that my
installation doesn't contain, so probably also outdated. That last
section should probably be moved into the main documentation, if it's
still relevant.

Between the main documentation and that README, it also becomes less
clear whether the SDK or Visual Studio Express or both are needed.

Then the real issue. The build.pl tries to call "vcbuild", which
neither the SDK version 7.1 nor the Visual Studio Express 2010 contain
anywhere. (There is a vcbuild.dll, but that's it.) Some web searching
suggests that vcbuild.exe might have been renamed in the Visual Studio
2010 version. I don't see any buildfarm coverage of that version.

So is 2010 supported, and where is the vcbuild program supposed to come
from?

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#4Magnus Hagander
magnus@hagander.net
In reply to: Andrew Dunstan (#2)
Re: Windows build issues

On Thu, Mar 31, 2011 at 22:00, Andrew Dunstan <andrew@dunslane.net> wrote:

On 03/31/2011 03:38 PM, Peter Eisentraut wrote:

So is 2010 supported, and where is the vcbuild program supposed to come
from?

Not that I know of. But VS 2008 is, and should be readily available. In
fact, I recently made patches to allow it to to be used to build all the
live branches.

Yeah, we had an initial patch for VS2010 support, but it wasn't quite
finished and it was decided to wait until 9.2.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Andrew Dunstan (#2)
Re: Windows build issues

On tor, 2011-03-31 at 16:00 -0400, Andrew Dunstan wrote:

On 03/31/2011 03:38 PM, Peter Eisentraut wrote:

So is 2010 supported, and where is the vcbuild program supposed to come
from?

Not that I know of. But VS 2008 is, and should be readily available. In
fact, I recently made patches to allow it to to be used to build all the
live branches.

The documentation appears to claim that the Platform/Windows SDK without
any Visual Studio should be enough. Is there also an upper limit on the
supported SDK version then?

#6Magnus Hagander
magnus@hagander.net
In reply to: Peter Eisentraut (#5)
Re: Windows build issues

On Thu, Mar 31, 2011 at 22:10, Peter Eisentraut <peter_e@gmx.net> wrote:

On tor, 2011-03-31 at 16:00 -0400, Andrew Dunstan wrote:

On 03/31/2011 03:38 PM, Peter Eisentraut wrote:

So is 2010 supported, and where is the vcbuild program supposed to come
from?

Not that I know of. But VS 2008 is, and should be readily available. In
fact, I recently made patches to allow it to to be used to build all the
live branches.

The documentation appears to claim that the Platform/Windows SDK without
any Visual Studio should be enough.  Is there also an upper limit on the
supported SDK version then?

It certainly used to be enough, so I guess if they have bounced the
version of the VC compiler that's included in the SDK then yes, there
needs to be an upper bound on it.

What version is the compiler that comes along with the SDK reporting?
(not the VS Express one, the one in the SDK itself)

Guessing fromhttp://en.wikipedia.org/wiki/Microsoft_Windows_SDK, maybe
we need to say up to v6.1 for now?

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

#7Peter Eisentraut
peter_e@gmx.net
In reply to: Magnus Hagander (#6)
Re: Windows build issues

On sön, 2011-04-03 at 16:04 +0200, Magnus Hagander wrote:

The documentation appears to claim that the Platform/Windows SDK without
any Visual Studio should be enough. Is there also an upper limit on the
supported SDK version then?

It certainly used to be enough, so I guess if they have bounced the
version of the VC compiler that's included in the SDK then yes, there
needs to be an upper bound on it.

What version is the compiler that comes along with the SDK reporting?
(not the VS Express one, the one in the SDK itself)

Guessing fromhttp://en.wikipedia.org/wiki/Microsoft_Windows_SDK, maybe
we need to say up to v6.1 for now?

I got it to build now. Here are is a list of notes that would make life
easier for future generations:

* As discussed, it should be noted that Visual Studio 2010 is not
supported yet.
* As previously mentioned, change Platform SDK to Windows SDK in
the documentation.
* I have some doubts about whether the SDK is at all needed or
whether it would suffice by itself. I went with Visual Studio
Express 2008.
* The build scripts should be made warnings-free with Perl 5.12,
which is the current default from ActiveState.
* There appears to be a bug in the GnuWin32 version of Bison that
is recommended to use, if you install it into a path that has
spaces in it, such as the default path C:\Program Files
\GnuWin32. The internal call to m4 chokes on that. Not our
bug, but perhaps worth warning about.
* vcregress.pl dies if there is no config.pl, even though the
other tools treat it as and the documentation claims it is
optional.
* clean.bat doesn't read buildenv.pl, causing a failure if you
have a path setting in there to find msbuild.exe.
* The major difficulty was figuring out the right path setting to
all the tools. The documentation is a bit hand-wavy about that.
In particular, it needed to find both vcbuild.exe and
msbuild.exe, which are conveniently hidden in C:\Program Files
\Microsoft Visual Studio 9.0\VC\vcpackages and C:\Windows
\Microsoft.NET\Framework\v2.0.50727 respectively. I'm not sure
if there is a pattern there that could be documented, but it
would really be helpful to at least give better hints about
this.
* It might also be in order to update pg_config.h.win32 relative
to the current pg_config.h.in.

#8Dave Page
dpage@pgadmin.org
In reply to: Peter Eisentraut (#7)
Re: Windows build issues

On Wed, Apr 6, 2011 at 6:27 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

     * I have some doubts about whether the SDK is at all needed or
       whether it would suffice by itself.  I went with Visual Studio
       Express 2008.

The SDK is needed with 2008 Express, but not the non-express version.
The SDK on it's own should be enough for command line compilation.

     * The major difficulty was figuring out the right path setting to
       all the tools.  The documentation is a bit hand-wavy about that.
       In particular, it needed to find both vcbuild.exe and
       msbuild.exe, which are conveniently hidden in C:\Program Files
       \Microsoft Visual Studio 9.0\VC\vcpackages and C:\Windows
       \Microsoft.NET\Framework\v2.0.50727 respectively.  I'm not sure
       if there is a pattern there that could be documented, but it
       would really be helpful to at least give better hints about
       this.

The SDK and/or Visual Studio should have created some shortcuts on the
menu to start command prompt windows with the appropriate environment
variables setup for you. On my system (which has Visual Studio 2008
Pro), there are shortcuts for 32 bit and 64 bit build environments.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#9Andrew Dunstan
andrew@dunslane.net
In reply to: Dave Page (#8)
Re: Windows build issues

On 04/06/2011 01:34 PM, Dave Page wrote:

On Wed, Apr 6, 2011 at 6:27 PM, Peter Eisentraut<peter_e@gmx.net> wrote:

* I have some doubts about whether the SDK is at all needed or
whether it would suffice by itself. I went with Visual Studio
Express 2008.

The SDK is needed with 2008 Express, but not the non-express version.
The SDK on it's own should be enough for command line compilation.

When you install VC Express 2008 the SDK is installed with it. A
separate install is not required, as it was with VCE 2005.

cheers

andrew

#10Brar Piening
brar@gmx.de
In reply to: Peter Eisentraut (#7)
Re: Windows build issues

On Wed, 06 Apr 2011 20:27:22 +0300, Peter Eisentraut
<peter_e@gmx.net> wrote:

I got it to build now. Here are is a list of notes that would make life
easier for future generations:

You might also want to have a look at my VS2010 patch as it already
touches some of those issues.

https://commitfest.postgresql.org/action/patch_view?id=523

It's not ready yet but I'm prepared to get back to it as soon as there's
some serious interest.
My personal plan is to get the good parts of it commited for 9.2

Regards,

Brar

#11Brar Piening
brar@gmx.de
In reply to: Brar Piening (#10)
Re: Windows build issues

On Wed, 06 Apr 2011 20:04:37 +0200, Brar Piening <brar@gmx.de> wrote:

It's not ready yet but I'm prepared to get back to it as soon as
there's some serious interest.

I've rebased the patch in case somebody wants to try it.

http://www.piening.info/VS2010v5.patch

Regards,

Brar

#12Andrew Dunstan
andrew@dunslane.net
In reply to: Andrew Dunstan (#9)
Re: Windows build issues

On 04/06/2011 01:47 PM, Andrew Dunstan wrote:

On 04/06/2011 01:34 PM, Dave Page wrote:

On Wed, Apr 6, 2011 at 6:27 PM, Peter Eisentraut<peter_e@gmx.net>
wrote:

* I have some doubts about whether the SDK is at all needed or
whether it would suffice by itself. I went with Visual Studio
Express 2008.

The SDK is needed with 2008 Express, but not the non-express version.
The SDK on it's own should be enough for command line compilation.

When you install VC Express 2008 the SDK is installed with it. A
separate install is not required, as it was with VCE 2005.

.... unless you want to build 64 bit binaries.

cheers

andrew

#13Dave Page
dpage@pgadmin.org
In reply to: Andrew Dunstan (#9)
Re: Windows build issues

On Wed, Apr 6, 2011 at 6:47 PM, Andrew Dunstan <andrew@dunslane.net> wrote:

On 04/06/2011 01:34 PM, Dave Page wrote:

On Wed, Apr 6, 2011 at 6:27 PM, Peter Eisentraut<peter_e@gmx.net>  wrote:

     * I have some doubts about whether the SDK is at all needed or
       whether it would suffice by itself.  I went with Visual Studio
       Express 2008.

The SDK is needed with 2008 Express, but not the non-express version.
The SDK on it's own should be enough for command line compilation.

When you install VC Express 2008 the SDK is installed with it. A separate
install is not required, as it was with VCE 2005.

Oh nice :-)

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#14Peter Eisentraut
peter_e@gmx.net
In reply to: Peter Eisentraut (#7)
Re: Windows build issues

Another issue:

...\src\tools\msvc>install "foo bar"
bar""=="" was unexpected at this time.

This makes it seemingly impossible to install into a standard location
such as under "C:\Program Files\".

#15Peter Eisentraut
peter_e@gmx.net
In reply to: Dave Page (#13)
Re: Windows build issues

On tor, 2011-04-07 at 09:26 +0100, Dave Page wrote:

On Wed, Apr 6, 2011 at 6:47 PM, Andrew Dunstan <andrew@dunslane.net> wrote:

On 04/06/2011 01:34 PM, Dave Page wrote:

On Wed, Apr 6, 2011 at 6:27 PM, Peter Eisentraut<peter_e@gmx.net> wrote:

* I have some doubts about whether the SDK is at all needed or
whether it would suffice by itself. I went with Visual Studio
Express 2008.

The SDK is needed with 2008 Express, but not the non-express version.
The SDK on it's own should be enough for command line compilation.

When you install VC Express 2008 the SDK is installed with it. A separate
install is not required, as it was with VCE 2005.

Oh nice :-)

Well, it's good that you guys are almost as confused as I am. :)

Evidently, VC Express 2008 is good by itself, without the separate SDK
download.

The documentation also appears to imply that the SDK without VC Express
would be enough. I can't quite fathom how that would work, because the
vcbuild.exe is supplied by VC Express. Then again, the SDK installation
offers to install a C++ compiler, but I don't know where it put that.

#16Magnus Hagander
magnus@hagander.net
In reply to: Peter Eisentraut (#15)
Re: Windows build issues

On Thu, Apr 7, 2011 at 22:11, Peter Eisentraut <peter_e@gmx.net> wrote:

On tor, 2011-04-07 at 09:26 +0100, Dave Page wrote:

On Wed, Apr 6, 2011 at 6:47 PM, Andrew Dunstan <andrew@dunslane.net> wrote:

On 04/06/2011 01:34 PM, Dave Page wrote:

On Wed, Apr 6, 2011 at 6:27 PM, Peter Eisentraut<peter_e@gmx.net>  wrote:

     * I have some doubts about whether the SDK is at all needed or
       whether it would suffice by itself.  I went with Visual Studio
       Express 2008.

The SDK is needed with 2008 Express, but not the non-express version.
The SDK on it's own should be enough for command line compilation.

When you install VC Express 2008 the SDK is installed with it. A separate
install is not required, as it was with VCE 2005.

Oh nice :-)

Well, it's good that you guys are almost as confused as I am. :)

yeah, it certainly is confusing.

Evidently, VC Express 2008 is good by itself, without the separate SDK
download.

The documentation also appears to imply that the SDK without VC Express
would be enough.  I can't quite fathom how that would work, because the
vcbuild.exe is supplied by VC Express.  Then again, the SDK installation
offers to install a C++ compiler, but I don't know where it put that.

The SDK supplies both the compiler and vcbuild.exe. At least it used
to - but since vcbuild isn't in VC 2010, iirc, it is not likely to be
in the new version of the SDK either..

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

#17Robert Haas
robertmhaas@gmail.com
In reply to: Peter Eisentraut (#15)
Re: Windows build issues

On Thu, Apr 7, 2011 at 4:11 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

On tor, 2011-04-07 at 09:26 +0100, Dave Page wrote:

On Wed, Apr 6, 2011 at 6:47 PM, Andrew Dunstan <andrew@dunslane.net> wrote:

On 04/06/2011 01:34 PM, Dave Page wrote:

On Wed, Apr 6, 2011 at 6:27 PM, Peter Eisentraut<peter_e@gmx.net>  wrote:

     * I have some doubts about whether the SDK is at all needed or
       whether it would suffice by itself.  I went with Visual Studio
       Express 2008.

The SDK is needed with 2008 Express, but not the non-express version.
The SDK on it's own should be enough for command line compilation.

When you install VC Express 2008 the SDK is installed with it. A separate
install is not required, as it was with VCE 2005.

Oh nice :-)

Well, it's good that you guys are almost as confused as I am. :)

Evidently, VC Express 2008 is good by itself, without the separate SDK
download.

The documentation also appears to imply that the SDK without VC Express
would be enough.  I can't quite fathom how that would work, because the
vcbuild.exe is supplied by VC Express.  Then again, the SDK installation
offers to install a C++ compiler, but I don't know where it put that.

It sure would be nice if someone would write a doc patch, or at least
a wiki page, explaining all the permutations here... I get the
impression it's not that hard to set up if you are reasonable
comfortable working in a Windows environment, but it's pretty
intimidating if you aren't.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#18Peter Eisentraut
peter_e@gmx.net
In reply to: Robert Haas (#17)
Re: Windows build issues

On tor, 2011-04-07 at 16:20 -0400, Robert Haas wrote:

It sure would be nice if someone would write a doc patch, or at least
a wiki page, explaining all the permutations here... I get the
impression it's not that hard to set up if you are reasonable
comfortable working in a Windows environment, but it's pretty
intimidating if you aren't.

Here's a patch I came up with that matches my experience, but evidently
there could be many others.

Attachments:

install-windows.patchtext/x-patch; charset=UTF-8; name=install-windows.patchDownload+48-26
#19Magnus Hagander
magnus@hagander.net
In reply to: Peter Eisentraut (#18)
Re: Windows build issues

On Mon, Apr 11, 2011 at 22:16, Peter Eisentraut <peter_e@gmx.net> wrote:

On tor, 2011-04-07 at 16:20 -0400, Robert Haas wrote:

It sure would be nice if someone would write a doc patch, or at least
a wiki page, explaining all the permutations here...  I get the
impression it's not that hard to set up if you are reasonable
comfortable working in a Windows environment, but it's pretty
intimidating if you aren't.

Here's a patch I came up with that matches my experience, but evidently
there could be many others.

Have we shown for sure that you can't build it with the compiler
that's in the SDK? If not, I still think that should be our primary
option - I certainly don't see how it's obsolete. (and you can,
afaics, still get the platform sdk with the correct version of the
compiler (non-vs2010), but I haven't tested it)

Or did I miss something in this thread?

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

#20Andrew Dunstan
andrew@dunslane.net
In reply to: Magnus Hagander (#19)
Re: Windows build issues

On 04/12/2011 08:23 AM, Magnus Hagander wrote:

On Mon, Apr 11, 2011 at 22:16, Peter Eisentraut<peter_e@gmx.net> wrote:

On tor, 2011-04-07 at 16:20 -0400, Robert Haas wrote:

It sure would be nice if someone would write a doc patch, or at least
a wiki page, explaining all the permutations here... I get the
impression it's not that hard to set up if you are reasonable
comfortable working in a Windows environment, but it's pretty
intimidating if you aren't.

Here's a patch I came up with that matches my experience, but evidently
there could be many others.

Have we shown for sure that you can't build it with the compiler
that's in the SDK? If not, I still think that should be our primary
option - I certainly don't see how it's obsolete. (and you can,
afaics, still get the platform sdk with the correct version of the
compiler (non-vs2010), but I haven't tested it)

Or did I miss something in this thread?

I haven't actually tried using the SDK alone. I'll try testing that on a
cloud appliance when I get a chance, as I'm out of Windows boxes I can
reasonable perturb. I do know you *need* the SDK for 64 bit builds with
VSE 2008, as it doesn't include a 64 bit compiler.

cheers

andrew

#21Magnus Hagander
magnus@hagander.net
In reply to: Andrew Dunstan (#20)
#22Brar Piening
brar@gmx.de
In reply to: Andrew Dunstan (#20)
#23Magnus Hagander
magnus@hagander.net
In reply to: Brar Piening (#22)
#24Brar Piening
brar@gmx.de
In reply to: Magnus Hagander (#23)
#25Magnus Hagander
magnus@hagander.net
In reply to: Brar Piening (#24)
#26Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Magnus Hagander (#25)
#27Magnus Hagander
magnus@hagander.net
In reply to: Alvaro Herrera (#26)
#28Brar Piening
brar@gmx.de
In reply to: Brar Piening (#11)
#29Brar Piening
brar@gmx.de
In reply to: Brar Piening (#28)