Bump minimum version of Flex to 2.5.35
authorJohn Naylor <john.naylor@postgresql.org>
Tue, 6 Sep 2022 04:41:58 +0000 (11:41 +0700)
committerJohn Naylor <john.naylor@postgresql.org>
Fri, 9 Sep 2022 05:55:23 +0000 (12:55 +0700)
Since the retirement of some older buildfarm members, the oldest Flex
that gets regular testing is 2.5.35.

Reviewed by Andres Freund
Discussion: https://www.postgresql.org/message-id/1097762.1662145681@sss.pgh.pa.us

config/programs.m4
configure
doc/src/sgml/install-windows.sgml
doc/src/sgml/installation.sgml
src/backend/utils/misc/guc-file.l
src/tools/msvc/pgflex.pl

index bcdfbc3a515b8752eeb1417134b6eb72acdd37a2..ce831555923d8666981cebd9ced7cd502011a4a4 100644 (file)
@@ -65,10 +65,8 @@ AC_SUBST(BISONFLAGS)
 # PGAC_PATH_FLEX
 # --------------
 # Look for Flex, set the output variable FLEX to its path if found.
-# Reject versions before 2.5.31, as we need a reasonably non-buggy reentrant
-# scanner.  (Note: the well-publicized security problem in 2.5.31 does not
-# affect Postgres, and there are still distros shipping patched 2.5.31,
-# so allow it.)  Also find Flex if its installed under `lex', but do not
+# Reject versions before 2.5.35 (the earliest version in the buildfarm
+# as of 2022). Also find Flex if its installed under `lex', but do not
 # accept other Lex programs.
 
 AC_DEFUN([PGAC_PATH_FLEX],
@@ -92,14 +90,14 @@ else
         echo '%%'  > conftest.l
         if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
           pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
-          if echo "$pgac_flex_version" | sed ['s/[.a-z]/ /g'] | $AWK '{ if ([$]1 == 2 && ([$]2 > 5 || ([$]2 == 5 && [$]3 >= 31))) exit 0; else exit 1;}'
+          if echo "$pgac_flex_version" | sed ['s/[.a-z]/ /g'] | $AWK '{ if ([$]1 == 2 && ([$]2 > 5 || ([$]2 == 5 && [$]3 >= 35))) exit 0; else exit 1;}'
           then
             pgac_cv_path_flex=$pgac_candidate
             break 2
           else
             AC_MSG_WARN([
 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
-*** Flex version 2.5.31 or later is required, but this is $pgac_flex_version.])
+*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version.])
           fi
         fi
       fi
index 4a725ab20583fd39b44aa072647751261d3107d2..613c385c480b7c414f56b4fc3ce64e6ace431b84 100755 (executable)
--- a/configure
+++ b/configure
@@ -10278,17 +10278,17 @@ else
         echo '%%'  > conftest.l
         if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
           pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
-          if echo "$pgac_flex_version" | sed 's/[.a-z]/ /g' | $AWK '{ if ($1 == 2 && ($2 > 5 || ($2 == 5 && $3 >= 31))) exit 0; else exit 1;}'
+          if echo "$pgac_flex_version" | sed 's/[.a-z]/ /g' | $AWK '{ if ($1 == 2 && ($2 > 5 || ($2 == 5 && $3 >= 35))) exit 0; else exit 1;}'
           then
             pgac_cv_path_flex=$pgac_candidate
             break 2
           else
             { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
-*** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&5
+*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version." >&5
 $as_echo "$as_me: WARNING:
 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
-*** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&2;}
+*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version." >&2;}
           fi
         fi
       fi
index 499fd59bf04c2e75681a8f9e24ca145e11094cfa..c00ab2b4b2dec83b3aedd38e83055d3d06e4b44b 100644 (file)
@@ -220,7 +220,7 @@ $ENV{MSBFLAGS}="/m";
       <productname>Bison</productname> and <productname>Flex</productname> are
       required to build from Git, but not required when building from a release
       file. Only <productname>Bison</productname> versions 2.3 and later
-      will work. <productname>Flex</productname> must be version 2.5.31 or later.
+      will work. <productname>Flex</productname> must be version 2.5.35 or later.
      </para>
 
      <para>
index 7f7f8428e14b48ee222ad95ca1f8e4ca10afb859..9daa656a048f2c4b426c59a80c8ec11d54aaeac0 100644 (file)
@@ -314,7 +314,7 @@ su - postgres
       <application>Flex</application> and <application>Bison</application>
       are needed to build from a Git checkout, or if you changed the actual
       scanner and parser definition files. If you need them, be sure
-      to get <application>Flex</application> 2.5.31 or later and
+      to get <application>Flex</application> 2.5.35 or later and
       <application>Bison</application> 2.3 or later. Other <application>lex</application>
       and <application>yacc</application> programs cannot be used.
      </para>
index 4f43430db4c36bde3df57993c5a648110795eab0..721628c0cf11976e0114630beea752e68e233adc 100644 (file)
@@ -332,8 +332,8 @@ record_config_file_error(const char *errmsg,
 /*
  * Flex fatal errors bring us here.  Stash the error message and jump back to
  * ParseConfigFp().  Assume all msg arguments point to string constants; this
- * holds for flex 2.5.31 (earliest we support) and flex 2.5.35 (latest as of
- * this writing).  Otherwise, we would need to copy the message.
+ * holds for flex 2.5.35 (earliest we support). Otherwise, we would need to
+ * copy the message.
  *
  * We return "int" since this takes the place of calls to fprintf().
 */
index eb3198381f602b6c07c2293c50f3fff6f1401830..b62478b9f59ef15349a0813ee40421288ce7cce4 100644 (file)
@@ -21,7 +21,7 @@ $flexver = (split(/\s+/, $flexver))[1];
 $flexver =~ s/[^0-9.]//g;
 my @verparts = split(/\./, $flexver);
 unless ($verparts[0] == 2
-   && ($verparts[1] > 5 || ($verparts[1] == 5 && $verparts[2] >= 31)))
+   && ($verparts[1] > 5 || ($verparts[1] == 5 && $verparts[2] >= 35)))
 {
    print "WARNING! Flex install not found, or unsupported Flex version.\n";
    print "echo Attempting to build without.\n";