flex on win64 - workaround for "flex: fatal internal error, exec failed"

Lists: pgsql-hackers
From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: pgsql-hackers(at)postgresql(dot)org
Subject: flex on win64 - workaround for "flex: fatal internal error, exec failed"
Date: 2011-07-03 23:12:48
Message-ID: 4E10F770.5020406@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi all

On my win64 build machine I've been suffering from hard to track down
errors from flex like:

"flex: fatal internal error, exec failed"

... even though I have m4 properly installed and whether or not the M4
environment variable is set to point to my M4 executable. It all works
fine under 32-bit windows using the same flex-2.5.35 obtained from Pg
ftp. Under win64 it works ... sometimes.

I haven't managed to figure out exactly what's broken. For the benefit
of anyone else having problems like this or who might find this via a
search later, though: just install msys and use the current flex from
msys. It works perfectly in Pg's build environment and it's easy to
install, so you don't need to stuff around trying to get flex to work.

Grab mingw-get-inst from
http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/
and use it to install msys and the minimalist mingw. You won't be using
mingw, but it won't hurt you, and it's easier than installing msys
standalone.

Edit src\tools\msvc\buildenv.pl (or create it if necessary) and use it
to add C:\MinGW\msys\1.0\bin to your PATH. Adjust as appropriate if your
MinGW install dir was different. Eg:

$ENV{PATH}='C:\MinGW\msys\1.0\bin;' . $ENV{PATH};

(As usual you'll probably need to add GnuWin32 and the paths to the
directories containing zlib1.dll, the openssl dlls, etc too).

--
Craig Ringer


From: Brar Piening <brar(at)gmx(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: flex on win64 - workaround for "flex: fatal internal error, exec failed"
Date: 2011-07-04 06:36:49
Message-ID: 4E115F81.9020605@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

schrieb Craig Ringer:
> I haven't managed to figure out exactly what's broken. For the benefit
> of anyone else having problems like this or who might find this via a
> search later, though: just install msys and use the current flex from
> msys. It works perfectly in Pg's build environment and it's easy to
> install, so you don't need to stuff around trying to get flex to work.
>
> Grab mingw-get-inst from
> http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/
> and use it to install msys and the minimalist mingw. You won't be
> using mingw, but it won't hurt you, and it's easier than installing
> msys standalone.
>
> Edit src\tools\msvc\buildenv.pl (or create it if necessary) and use it
> to add C:\MinGW\msys\1.0\bin to your PATH. Adjust as appropriate if
> your MinGW install dir was different. Eg:
>
> $ENV{PATH}='C:\MinGW\msys\1.0\bin;' . $ENV{PATH};

As you might also want to use git for developing with postgres its
possible that all you need is already in place.

As I use msysgit my usual way of dealing with flex and bison
dependencies is putting "$ENV{PATH}=$ENV{PATH} . ';C:\Program Files
(x86)\Git\bin';" into my buildenv.pl

Regards,

Brar


From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Brar Piening <brar(at)gmx(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: flex on win64 - workaround for "flex: fatal internal error, exec failed"
Date: 2011-07-04 09:28:52
Message-ID: 4E1187D4.7010301@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 4/07/2011 2:36 PM, Brar Piening wrote:

> As you might also want to use git for developing with postgres its
> possible that all you need is already in place.
>
> As I use msysgit my usual way of dealing with flex and bison
> dependencies is putting "$ENV{PATH}=$ENV{PATH} . ';C:\Program Files
> (x86)\Git\bin';" into my buildenv.pl

Good thought. I hadn't realized msysgit bundled flex and bison - that's
really handy. I generally use git from a `vsvars' cmd.exe shell not bash
simply because some tools don't play well with bash, and I only have git
on the PATH so I didn't realize flex was bundled. Handy!

I wonder if the docs should be recommending using msys's flex and bison
(via msysgit or mingw) rather than GnuWin32? Pointing to a matching m4,
flex and bison that're kept up to date and easy to install might be a
good thing.

--
Craig Ringer