Обсуждение: Autoconf test for incompatible version of flex

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

Autoconf test for incompatible version of flex

От
Greg Stark
Дата:
This patch adds an autoconf test to check for the new incompatible version of
flex.


--- programs.m4.~1.12.~    2003-05-06 19:33:52.000000000 -0400
+++ programs.m4    2003-07-04 20:45:47.000000000 -0400
@@ -30,6 +30,10 @@
             pgac_broken_flex=$pgac_candidate
             continue
           fi
+          if $pgac_candidate --version | grep ' 2\.5\.[[3-9][0-9]]$' >/dev/null 2>&1; then
+            pgac_new_flex=$pgac_candidate
+            continue
+          fi

           pgac_cv_path_flex=$pgac_candidate
           break 2
@@ -49,6 +53,12 @@
 *** The Flex version 2.5.3 you have at $pgac_broken_flex contains a bug. You
 *** should get version 2.5.4 or later.])
   fi
+  if test -n "$pgac_new_flex"; then
+    AC_MSG_WARN([
+*** The Flex version you have at $pgac_new_flex is a version PostgreSQL does
+*** not support. There were major incompatible API changes in this release of
+*** Flex. To compile PostgreSQL you should get version no later than 2.5.4a.])
+  fi

   AC_MSG_WARN([
 *** Without Flex you will not be able to build PostgreSQL from CVS or



--
greg

Re: Autoconf test for incompatible version of flex

От
Tom Lane
Дата:
Greg Stark <gsstark@mit.edu> writes:
> This patch adds an autoconf test to check for the new incompatible version of
> flex.

It seems unlikely that we should cause configure to reject all future
versions of flex... .31 may be broken but I think we should assume that
they'l fix it.

            regards, tom lane

Re: Autoconf test for incompatible version of flex

От
Greg Stark
Дата:
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Greg Stark <gsstark@mit.edu> writes:
> > This patch adds an autoconf test to check for the new incompatible version of
> > flex.
>
> It seems unlikely that we should cause configure to reject all future
> versions of flex... .31 may be broken but I think we should assume that
> they'l fix it.

I inquired about this problem elsewhere, it's not a bug, it's an API change.
Until postgres "ports" to the new API it won't work with newer versions of
Flex.

From the Debian maintainer of the flex package
(http://bugs.debian.org/199776):

>         The signature of all functions has changed. flex has new
>  command line options, and option parsing has changed (now also
>  supports POSIX conventions optionally). Handles POSIXLY_CORRECT
>  environment variable.  Various i18n translations are included in the
>  distribution. flex now works with recent bison versions
>
>         This is not a single short lived change.
>
>         I understand that this requires all packages using lex to
>  massage their lexers to conform to the new behaviour of flex; but the
>  gains in reduced complexity of the scanner and reentrancy and
>  standards compliance are well worth it.

--
greg

Re: Autoconf test for incompatible version of flex

От
Tom Lane
Дата:
Greg Stark <gsstark@mit.edu> writes:
> I inquired about this problem elsewhere, it's not a bug, it's an API change.
> Until postgres "ports" to the new API it won't work with newer versions of
> Flex.

If their intent was to break things, why wasn't this called flex 3.0?
Or at least 2.6?  Calling it a minor version bump has to violate a
truth-in-advertising law or two.

            regards, tom lane

Re: Autoconf test for incompatible version of flex

От
Greg Stark
Дата:
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Greg Stark <gsstark@mit.edu> writes:
> > I inquired about this problem elsewhere, it's not a bug, it's an API change.
> > Until postgres "ports" to the new API it won't work with newer versions of
> > Flex.
>
> If their intent was to break things, why wasn't this called flex 3.0?
> Or at least 2.6?  Calling it a minor version bump has to violate a
> truth-in-advertising law or two.

Or something else like "glex", since it doesn't really look much like flex any
more... I don't know whether it will be possible to port to the new API and
still have postgresql compile with the old API.

Incidentally, for anyone else compiling on debian there's a flex-old package.
I can't install it because of some other dependencies, so i just reverted to
the old flex.

--
greg

Re: Autoconf test for incompatible version of flex

От
Tom Lane
Дата:
[ followup to old message ]

Greg Stark <gsstark@mit.edu> writes:
> This patch adds an autoconf test to check for the new incompatible version of
> flex.

Peter E. claims that CVS tip does work with flex 2.5.31 --- so we
shouldn't need this patch anymore.

            regards, tom lane

Re: Autoconf test for incompatible version of flex

От
Bruce Momjian
Дата:
Yes, that was my conclusion too.

---------------------------------------------------------------------------

Tom Lane wrote:
> [ followup to old message ]
>
> Greg Stark <gsstark@mit.edu> writes:
> > This patch adds an autoconf test to check for the new incompatible version of
> > flex.
>
> Peter E. claims that CVS tip does work with flex 2.5.31 --- so we
> shouldn't need this patch anymore.
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073