vcbuild bison check

Started by Magnus Haganderover 19 years ago18 messages
#1Magnus Hagander
mha@sollentuna.net
1 attachment(s)

Attached patch adds a version check for bison when running the vc++
build.

//Magnus <<vcbuild_bison.diff>>

Attachments:

vcbuild_bison.diffapplication/octet-stream; name=vcbuild_bison.diffDownload
Index: tools\msvc/pgbison.bat
===================================================================
RCS file: c:/prog/cvsrepo/pgsql/pgsql/src/tools/msvc/pgbison.bat,v
retrieving revision 1.1
diff -c -r1.1 pgbison.bat
*** tools\msvc/pgbison.bat	4 Sep 2006 21:30:40 -0000	1.1
--- tools\msvc/pgbison.bat	3 Oct 2006 19:32:07 -0000
***************
*** 1,5 ****
  @echo off

! bison -V > NUL

  if errorlevel 1 goto nobison

  

  if "%1" == "src\backend\parser\gram.y" call :generate %1 src\backend\parser\gram.c src\include\parser\parse.h

--- 1,5 ----
  @echo off

! bison -V |findstr 1.875 > NUL

  if errorlevel 1 goto nobison

  

  if "%1" == "src\backend\parser\gram.y" call :generate %1 src\backend\parser\gram.c src\include\parser\parse.h

***************
*** 23,27 ****
  

  

  :nobison

! echo WARNING! Bison install not found, attempting to build without!

  exit 0

--- 23,28 ----
  

  

  :nobison

! echo WARNING! Bison install not found, or unsupported Bison version.
! echo Attempting to build without.

  exit 0

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#1)
Re: vcbuild bison check

"Magnus Hagander" <mha@sollentuna.net> writes:

Attached patch adds a version check for bison when running the vc++
build.

Shouldn't it be looking for 2.1 as well?

regards, tom lane

#3Magnus Hagander
mha@sollentuna.net
In reply to: Tom Lane (#2)
Re: vcbuild bison check

Attached patch adds a version check for bison when running the vc++
build.

Shouldn't it be looking for 2.1 as well?

2.1 is the broken one. It seemd it was fixed in 2.2, but 2.2 isn't
realeased for win32 from what I cna tell.

//Magnus

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#3)
Re: vcbuild bison check

"Magnus Hagander" <mha@sollentuna.net> writes:

Attached patch adds a version check for bison when running the vc++
build.

Shouldn't it be looking for 2.1 as well?

2.1 is the broken one.

Exactly. So we should reject it.

It seemd it was fixed in 2.2, but 2.2 isn't
realeased for win32 from what I cna tell.

What's that got to do with rejecting 2.1?

regards, tom lane

#5Magnus Hagander
mha@sollentuna.net
In reply to: Tom Lane (#4)
Re: vcbuild bison check

Attached patch adds a version check for bison when running the

vc++

build.

Shouldn't it be looking for 2.1 as well?

2.1 is the broken one.

Exactly. So we should reject it.

We do. The code as-is *only* accepts 1.875. Thus it rejects 2.1.

//Magnus

#6Bruce Momjian
bruce@momjian.us
In reply to: Magnus Hagander (#5)
Re: vcbuild bison check

Magnus Hagander wrote:

Attached patch adds a version check for bison when running the

vc++

build.

Shouldn't it be looking for 2.1 as well?

2.1 is the broken one.

Exactly. So we should reject it.

We do. The code as-is *only* accepts 1.875. Thus it rejects 2.1.

I think Tom's point is that we should reject only 2.1. Isn't that the
only version that fails?

--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#7Magnus Hagander
mha@sollentuna.net
In reply to: Bruce Momjian (#6)
Re: [PATCHES] vcbuild bison check

2.1 is the broken one.

Exactly. So we should reject it.

We do. The code as-is *only* accepts 1.875. Thus it rejects 2.1.

I think Tom's point is that we should reject only 2.1. Isn't
that the only version that fails?

Not entirely sure. I beleive there were older versions that don't work
as well... And you can't expect lots of older versions around - I'm sure
*at least* 99% of the ppl who are building withthis will download bison
specifically for this. And given that, they're going to get the latest
by default, or 1.875 if they read the (currently being written) README.

//Magnus

#8Zeugswetter Andreas DCP SD
ZeugswetterA@spardat.at
In reply to: Magnus Hagander (#7)
Re: [PATCHES] vcbuild bison check

And given that, they're going to get the latest by default,
or 1.875 if they read the (currently being written) README.

The point was, that >= 2.2 won't be allowed when it comes out for win32,
even if it should work.

Andreas

#9Magnus Hagander
mha@sollentuna.net
In reply to: Zeugswetter Andreas DCP SD (#8)
Re: [PATCHES] vcbuild bison check

And given that, they're going to get the latest by default, or

1.875

if they read the (currently being written) README.

The point was, that >= 2.2 won't be allowed when it comes out for
win32, even if it should work.

Right. So I'd update it once we see a working version other than 1.875.

//mha

#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#9)
Re: [PATCHES] vcbuild bison check

"Magnus Hagander" <mha@sollentuna.net> writes:

The point was, that >= 2.2 won't be allowed when it comes out for
win32, even if it should work.

Right. So I'd update it once we see a working version other than 1.875.

No, we should ship it that way to start with. Otherwise we're going to
get caught with no released source code that will allow 2.2.

A look at ftp.gnu.org says that 2.2 was released 19-May-2006 and
2.3 was released 05-Jun-2006. So it's not like these versions are
fresh off the boat. I think it's safe to assume that someone will
bother to compile them for Windows, probably sooner not later.
We should be making sure our code works with them, rather than
making sure it doesn't.

regards, tom lane

#11Magnus Hagander
mha@sollentuna.net
In reply to: Tom Lane (#10)
Re: [PATCHES] vcbuild bison check

The point was, that >= 2.2 won't be allowed when it comes out

for

win32, even if it should work.

Right. So I'd update it once we see a working version other than

1.875.

No, we should ship it that way to start with. Otherwise we're
going to get caught with no released source code that will allow
2.2.

A look at ftp.gnu.org says that 2.2 was released 19-May-2006 and
2.3 was released 05-Jun-2006. So it's not like these versions are
fresh off the boat. I think it's safe to assume that someone will
bother to compile them for Windows, probably sooner not later.
We should be making sure our code works with them, rather than
making sure it doesn't.

Ok. So what you want is something that checks that it's >=1.875 but
specifically not 2.1?

Might be a while before I can submit an updated patch for that, may need
to rewrite the whole script in perl to do that :-( .bat files are
horribly limited in what they can do.

//Magnus

#12Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#7)
Re: [PATCHES] vcbuild bison check

"Magnus Hagander" <mha@sollentuna.net> writes:

I think Tom's point is that we should reject only 2.1. Isn't
that the only version that fails?

Not entirely sure. I beleive there were older versions that don't work
as well...

My recollection is that the version immediately prior to 1.875 was
actively broken, and that versions much before that fail to cope with
the current size of our grammar.

What I see in ftp.gnu.org since 1.875 are 2.0, 2.1, 2.2, 2.3. We do not
know at this point whether the extra-semicolon bug is present in 2.0
or only 2.1 ... but I will download them and find out.

regards, tom lane

#13Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#11)
Re: [PATCHES] vcbuild bison check

"Magnus Hagander" <mha@sollentuna.net> writes:

Ok. So what you want is something that checks that it's >=1.875 but
specifically not 2.1?

Let me finish investigating the 2.x series and get back to you on that.

Might be a while before I can submit an updated patch for that, may need
to rewrite the whole script in perl to do that :-( .bat files are
horribly limited in what they can do.

I see no big reason for hurry here, as long as it's in before RC1.

regards, tom lane

#14Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#13)
Re: [PATCHES] vcbuild bison check

I wrote:

Let me finish investigating the 2.x series and get back to you on that.

2.1 indeed seems to be the only version that emits the busted semicolon.
I found that 2.2 and 2.3 both fail one of their "make check" tests on my
machine --- if that's widespread it might explain a slow uptake rate for
these versions :-(. But the failure is in one of the GLR tests and
shouldn't affect us. All four 2.x versions produce gram.c files that
compile and pass regression for me.

So I'd vote for "allow 1.875 and up, except 2.1 specifically".

regards, tom lane

#15Zeugswetter Andreas DCP SD
ZeugswetterA@spardat.at
In reply to: Magnus Hagander (#11)
Re: [PATCHES] vcbuild bison check

Ok. So what you want is something that checks that it's

=1.875 but specifically not 2.1?

Might be a while before I can submit an updated patch for
that, may need to rewrite the whole script in perl to do that
:-( .bat files are horribly limited in what they can do.

Since we are on NT or higher you could use extensions:
IF %bversion% GEQ 1.875 IF %bversion% NEQ 2.1 goto use_bison
http://www.robvanderwoude.com/ntif.html

(even in .bat files) to avoid converting to perl.
sorry, haven't looked at the file so needs adaption

Thank you for the work
Andreas

#16Magnus Hagander
mha@sollentuna.net
In reply to: Zeugswetter Andreas DCP SD (#15)
Re: [PATCHES] vcbuild bison check

Ok. So what you want is something that checks that it's

=1.875 but specifically not 2.1?

Might be a while before I can submit an updated patch for that,

may

need to rewrite the whole script in perl to do that :-( .bat

files are

horribly limited in what they can do.

Since we are on NT or higher you could use extensions:
IF %bversion% GEQ 1.875 IF %bversion% NEQ 2.1 goto use_bison
http://www.robvanderwoude.com/ntif.html

I thought that only worked if your locale was set to something that has
dot as decimal separator. Mine has comma, as have many others...

//Magnus

#17Zeugswetter Andreas DCP SD
ZeugswetterA@spardat.at
In reply to: Magnus Hagander (#16)
Re: [PATCHES] vcbuild bison check

-----Original Message-----
From: Magnus Hagander [mailto:mha@sollentuna.net]
Sent: Wednesday, October 04, 2006 6:01 PM
To: Zeugswetter Andreas ADI SD
Cc: pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] [PATCHES] vcbuild bison check

Ok. So what you want is something that checks that it's

=1.875 but specifically not 2.1?

Might be a while before I can submit an updated patch for that,

may

need to rewrite the whole script in perl to do that :-( .bat

files are

horribly limited in what they can do.

Since we are on NT or higher you could use extensions:
IF %bversion% GEQ 1.875 IF %bversion% NEQ 2.1 goto use_bison
http://www.robvanderwoude.com/ntif.html

I thought that only worked if your locale was set to
something that has dot as decimal separator. Mine has comma,
as have many others...

Um, I think it does a string compare because point or comma is no
decimal digit,
but that would imho also be sufficient.
My locale is German, so my decimal sep should also be a comma, and it
worked
for the mentioned versions.

Andreas

#18Andrew Dunstan
andrew@dunslane.net
In reply to: Magnus Hagander (#16)
Re: [PATCHES] vcbuild bison check

Magnus Hagander wrote:

Ok. So what you want is something that checks that it's

=1.875 but specifically not 2.1?

Might be a while before I can submit an updated patch for that,

may

need to rewrite the whole script in perl to do that :-( .bat

files are

horribly limited in what they can do.

Since we are on NT or higher you could use extensions:
IF %bversion% GEQ 1.875 IF %bversion% NEQ 2.1 goto use_bison
http://www.robvanderwoude.com/ntif.html

I thought that only worked if your locale was set to something that has
dot as decimal separator. Mine has comma, as have many others...

Won't it just do a string comparison, then? That's probably good enough
in this instance.

cheers

andrew