From b33f36166fdb5b9dec746ba721881d696241e291 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 9 Jan 2025 08:41:28 +0100 Subject: [PATCH 2/2] Raise minimum flex version to 2.5.37 --- config/programs.m4 | 8 ++++---- configure | 4 ++-- doc/src/sgml/installation.sgml | 4 ++-- meson.build | 2 +- src/backend/utils/misc/guc-file.l | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/programs.m4 b/config/programs.m4 index 490ec9fe9f5..417a4f6d06c 100644 --- a/config/programs.m4 +++ b/config/programs.m4 @@ -59,8 +59,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.35 (the earliest version in the buildfarm -# as of 2022). Also find Flex if its installed under `lex', but do not +# Reject versions before 2.5.37 (the earliest version in the buildfarm +# as of 2025). Also find Flex if its installed under `lex', but do not # accept other Lex programs. AC_DEFUN([PGAC_PATH_FLEX], @@ -84,14 +84,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 >= 35))) exit 0; else exit 1;}' + if echo "$pgac_flex_version" | sed ['s/[.a-z]/ /g'] | $AWK '{ if ([$]1 == 2 && ([$]2 > 5 || ([$]2 == 5 && [$]3 >= 37))) exit 0; else exit 1;}' then pgac_cv_path_flex=$pgac_candidate break 2 else AC_MSG_ERROR([ *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL. -*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version.]) +*** Flex version 2.5.37 or later is required, but this is $pgac_flex_version.]) fi fi fi diff --git a/configure b/configure index a0b5e10ca39..6f50ab4d7eb 100755 --- a/configure +++ b/configure @@ -9955,14 +9955,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 >= 35))) exit 0; else exit 1;}' + if echo "$pgac_flex_version" | sed 's/[.a-z]/ /g' | $AWK '{ if ($1 == 2 && ($2 > 5 || ($2 == 5 && $3 >= 37))) exit 0; else exit 1;}' then pgac_cv_path_flex=$pgac_candidate break 2 else as_fn_error $? " *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL. -*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version." "$LINENO" 5 +*** Flex version 2.5.37 or later is required, but this is $pgac_flex_version." "$LINENO" 5 fi fi fi diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index ebdb5b3bc2d..c6dfbf0bfd3 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -100,7 +100,7 @@ Requirements yacc - Flex 2.5.35 or later and + Flex 2.5.37 or later and Bison 2.3 or later are required. Other lex and yacc programs cannot be used. @@ -3813,7 +3813,7 @@ Requirements Bison and Flex are required. Only Bison versions 2.3 and later - will work. Flex must be version 2.5.35 or later. + will work. Flex must be version 2.5.37 or later. Binaries can be downloaded from . diff --git a/meson.build b/meson.build index cfd654d2916..ae0dfa852af 100644 --- a/meson.build +++ b/meson.build @@ -334,7 +334,7 @@ endif # External programs perl = find_program(get_option('PERL'), required: true, native: true) python = find_program(get_option('PYTHON'), required: true, native: true) -flex = find_program(get_option('FLEX'), native: true, version: '>= 2.5.35') +flex = find_program(get_option('FLEX'), native: true, version: '>= 2.5.37') bison = find_program(get_option('BISON'), native: true, version: '>= 2.3') sed = find_program(get_option('SED'), 'sed', native: true, required: false) prove = find_program(get_option('PROVE'), native: true, required: false) diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l index c0ecb8b2ce2..280c3320954 100644 --- a/src/backend/utils/misc/guc-file.l +++ b/src/backend/utils/misc/guc-file.l @@ -302,7 +302,7 @@ 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.35 (earliest we support). Otherwise, we would need to + * holds for flex 2.5.37 (earliest we support). Otherwise, we would need to * copy the message. * * We return "int" since this takes the place of calls to fprintf(). -- 2.47.1