Skip to content

Commit 8b878bf

Browse files
committed
Bump minimum version of Flex to 2.5.35
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
1 parent b086a47 commit 8b878bf

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

config/programs.m4

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,8 @@ AC_SUBST(BISONFLAGS)
6565
# PGAC_PATH_FLEX
6666
# --------------
6767
# Look for Flex, set the output variable FLEX to its path if found.
68-
# Reject versions before 2.5.31, as we need a reasonably non-buggy reentrant
69-
# scanner. (Note: the well-publicized security problem in 2.5.31 does not
70-
# affect Postgres, and there are still distros shipping patched 2.5.31,
71-
# so allow it.) Also find Flex if its installed under `lex', but do not
68+
# Reject versions before 2.5.35 (the earliest version in the buildfarm
69+
# as of 2022). Also find Flex if its installed under `lex', but do not
7270
# accept other Lex programs.
7371

7472
AC_DEFUN([PGAC_PATH_FLEX],
@@ -92,14 +90,14 @@ else
9290
echo '%%' > conftest.l
9391
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
9492
pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
95-
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;}'
93+
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;}'
9694
then
9795
pgac_cv_path_flex=$pgac_candidate
9896
break 2
9997
else
10098
AC_MSG_WARN([
10199
*** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
102-
*** Flex version 2.5.31 or later is required, but this is $pgac_flex_version.])
100+
*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version.])
103101
fi
104102
fi
105103
fi

configure

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10278,17 +10278,17 @@ else
1027810278
echo '%%' > conftest.l
1027910279
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
1028010280
pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
10281-
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;}'
10281+
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;}'
1028210282
then
1028310283
pgac_cv_path_flex=$pgac_candidate
1028410284
break 2
1028510285
else
1028610286
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
1028710287
*** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
10288-
*** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&5
10288+
*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version." >&5
1028910289
$as_echo "$as_me: WARNING:
1029010290
*** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
10291-
*** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&2;}
10291+
*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version." >&2;}
1029210292
fi
1029310293
fi
1029410294
fi

doc/src/sgml/install-windows.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ $ENV{MSBFLAGS}="/m";
220220
<productname>Bison</productname> and <productname>Flex</productname> are
221221
required to build from Git, but not required when building from a release
222222
file. Only <productname>Bison</productname> versions 2.3 and later
223-
will work. <productname>Flex</productname> must be version 2.5.31 or later.
223+
will work. <productname>Flex</productname> must be version 2.5.35 or later.
224224
</para>
225225

226226
<para>

doc/src/sgml/installation.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ su - postgres
314314
<application>Flex</application> and <application>Bison</application>
315315
are needed to build from a Git checkout, or if you changed the actual
316316
scanner and parser definition files. If you need them, be sure
317-
to get <application>Flex</application> 2.5.31 or later and
317+
to get <application>Flex</application> 2.5.35 or later and
318318
<application>Bison</application> 2.3 or later. Other <application>lex</application>
319319
and <application>yacc</application> programs cannot be used.
320320
</para>

src/backend/utils/misc/guc-file.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ record_config_file_error(const char *errmsg,
332332
/*
333333
* Flex fatal errors bring us here. Stash the error message and jump back to
334334
* ParseConfigFp(). Assume all msg arguments point to string constants; this
335-
* holds for flex 2.5.31 (earliest we support) and flex 2.5.35 (latest as of
336-
* this writing). Otherwise, we would need to copy the message.
335+
* holds for flex 2.5.35 (earliest we support). Otherwise, we would need to
336+
* copy the message.
337337
*
338338
* We return "int" since this takes the place of calls to fprintf().
339339
*/

src/tools/msvc/pgflex.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
$flexver =~ s/[^0-9.]//g;
2222
my @verparts = split(/\./, $flexver);
2323
unless ($verparts[0] == 2
24-
&& ($verparts[1] > 5 || ($verparts[1] == 5 && $verparts[2] >= 31)))
24+
&& ($verparts[1] > 5 || ($verparts[1] == 5 && $verparts[2] >= 35)))
2525
{
2626
print "WARNING! Flex install not found, or unsupported Flex version.\n";
2727
print "echo Attempting to build without.\n";

0 commit comments

Comments
 (0)