Bump minimum version of Bison to 2.3
authorJohn Naylor <[email protected]>
Tue, 6 Sep 2022 04:41:58 +0000 (11:41 +0700)
committerJohn Naylor <[email protected]>
Fri, 9 Sep 2022 05:31:41 +0000 (12:31 +0700)
Since the retirement of some older buildfarm members, the oldest Bison
that gets regular testing is 2.3. MacOS ships that version, and will
continue doing so for the forseeable future because of Apple's policy
regarding GPLv3. While Mac users could use a package manager to install
a newer version, there is no compelling reason to force them do so at
this time.

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

13 files changed:
config/programs.m4
configure
contrib/cube/cubeparse.y
contrib/seg/segparse.y
doc/src/sgml/install-windows.sgml
doc/src/sgml/installation.sgml
src/backend/bootstrap/bootparse.y
src/backend/parser/gram.y
src/backend/replication/repl_gram.y
src/backend/replication/syncrep_gram.y
src/backend/utils/adt/jsonpath_gram.y
src/pl/plpgsql/src/pl_gram.y
src/tools/msvc/pgbison.pl

index e7908d87934102b16abf4dea79385a8dc87b6aaf..bcdfbc3a515b8752eeb1417134b6eb72acdd37a2 100644 (file)
@@ -22,8 +22,8 @@ fi
 # PGAC_PATH_BISON
 # ---------------
 # Look for Bison, set the output variable BISON to its path if found.
-# Reject versions before 1.875 (they have bugs or capacity limits).
-# Note we do not accept other implementations of yacc.
+# Reject versions before 2.3 (the earliest version in the buildfarm
+# as of 2022). Note we do not accept other implementations of yacc.
 
 AC_DEFUN([PGAC_PATH_BISON],
 [PGAC_PATH_PROGS(BISON, bison)
@@ -31,11 +31,11 @@ AC_DEFUN([PGAC_PATH_BISON],
 if test "$BISON"; then
   pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
   AC_MSG_NOTICE([using $pgac_bison_version])
-  if echo "$pgac_bison_version" | $AWK '{ if ([$]4 < 1.875) exit 0; else exit 1;}'
+  if echo "$pgac_bison_version" | $AWK '{ if ([$]4 < 2.3) exit 0; else exit 1;}'
   then
     AC_MSG_WARN([
 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
-*** Bison version 1.875 or later is required, but this is $pgac_bison_version.])
+*** Bison version 2.3 or later is required, but this is $pgac_bison_version.])
     BISON=""
   fi
   # Bison >=3.0 issues warnings about %name-prefix="base_yy", instead
index a268780c5dbd314e3a252deda80e9c8121bb9662..4a725ab20583fd39b44aa072647751261d3107d2 100755 (executable)
--- a/configure
+++ b/configure
@@ -10218,14 +10218,14 @@ if test "$BISON"; then
   pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_bison_version" >&5
 $as_echo "$as_me: using $pgac_bison_version" >&6;}
-  if echo "$pgac_bison_version" | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'
+  if echo "$pgac_bison_version" | $AWK '{ if ($4 < 2.3) exit 0; else exit 1;}'
   then
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
-*** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&5
+*** Bison version 2.3 or later is required, but this is $pgac_bison_version." >&5
 $as_echo "$as_me: WARNING:
 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
-*** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&2;}
+*** Bison version 2.3 or later is required, but this is $pgac_bison_version." >&2;}
     BISON=""
   fi
   # Bison >=3.0 issues warnings about %name-prefix="base_yy", instead
index 6cceae8e996904e51315f18791a6adbe878fdd7f..977dcba965059aaf794e7ca79a5ded6ed0acab4d 100644 (file)
 /*
  * Bison doesn't allocate anything that needs to live across parser calls,
  * so we can easily have it use palloc instead of malloc.  This prevents
- * memory s if we error out during parsing.  Note this only works with
- * bison >= 2.0.  However, in bison 1.875 the default is to use alloca()
- * if possible, so there's not really much problem anyhow, at least if
- * you're building with gcc.
+ * memory s if we error out during parsing.
  */
 #define YYMALLOC palloc
 #define YYFREE   pfree
index 637eacd1a65d1107b7f015d711e5aeadae21cdd7..1d2adbbec893f018ddc440fa1a289f8c23b001ad 100644 (file)
 /*
  * Bison doesn't allocate anything that needs to live across parser calls,
  * so we can easily have it use palloc instead of malloc.  This prevents
- * memory s if we error out during parsing.  Note this only works with
- * bison >= 2.0.  However, in bison 1.875 the default is to use alloca()
- * if possible, so there's not really much problem anyhow, at least if
- * you're building with gcc.
+ * memory s if we error out during parsing.
  */
 #define YYMALLOC palloc
 #define YYFREE   pfree
index 11e153578c0b1978bdb01f2236c19eab64b2a137..499fd59bf04c2e75681a8f9e24ca145e11094cfa 100644 (file)
@@ -219,7 +219,7 @@ $ENV{MSBFLAGS}="/m";
      <para>
       <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> 1.875 or versions 2.2 and later
+      file. Only <productname>Bison</productname> versions 2.3 and later
       will work. <productname>Flex</productname> must be version 2.5.31 or later.
      </para>
 
index 70d188e2bc4960e8c18a3b1038214b93ac51a4ee..7f7f8428e14b48ee222ad95ca1f8e4ca10afb859 100644 (file)
@@ -315,7 +315,7 @@ su - postgres
       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
-      <application>Bison</application> 1.875 or later. Other <application>lex</application>
+      <application>Bison</application> 2.3 or later. Other <application>lex</application>
       and <application>yacc</application> programs cannot be used.
      </para>
     </listitem>
index c45ddde67f2b15138021b4c63d6cee977b015c36..e6d62d81c17e17d714a15e32d7042f3e9abc8ff7 100644 (file)
 /*
  * Bison doesn't allocate anything that needs to live across parser calls,
  * so we can easily have it use palloc instead of malloc.  This prevents
- * memory s if we error out during parsing.  Note this only works with
- * bison >= 2.0.  However, in bison 1.875 the default is to use alloca()
- * if possible, so there's not really much problem anyhow, at least if
- * you're building with gcc.
+ * memory s if we error out during parsing.
  */
 #define YYMALLOC palloc
 #define YYFREE   pfree
index 0492ff9a666c33c177261860e92ffe50f05e2e2b..ea33784316df18c0d1618651197f91fb89e20801 100644 (file)
 /*
  * Bison doesn't allocate anything that needs to live across parser calls,
  * so we can easily have it use palloc instead of malloc.  This prevents
- * memory s if we error out during parsing.  Note this only works with
- * bison >= 2.0.  However, in bison 1.875 the default is to use alloca()
- * if possible, so there's not really much problem anyhow, at least if
- * you're building with gcc.
+ * memory s if we error out during parsing.
  */
 #define YYMALLOC palloc
 #define YYFREE   pfree
index b343f108d3158829be5070d5278fd3c8c331e82e..8ff6ab362fd06a486bad625685c68b54a6330b73 100644 (file)
@@ -29,10 +29,7 @@ Node *replication_parse_result;
 /*
  * Bison doesn't allocate anything that needs to live across parser calls,
  * so we can easily have it use palloc instead of malloc.  This prevents
- * memory s if we error out during parsing.  Note this only works with
- * bison >= 2.0.  However, in bison 1.875 the default is to use alloca()
- * if possible, so there's not really much problem anyhow, at least if
- * you're building with gcc.
+ * memory s if we error out during parsing.
  */
 #define YYMALLOC palloc
 #define YYFREE   pfree
index 4fc3647da15eeb2eddcee3510656e8e939255cb2..c18ddb2e9bc6d64178995e2f83829e77da5e085a 100644 (file)
@@ -26,10 +26,7 @@ static SyncRepConfigData *create_syncrep_config(const char *num_sync,
 /*
  * Bison doesn't allocate anything that needs to live across parser calls,
  * so we can easily have it use palloc instead of malloc.  This prevents
- * memory s if we error out during parsing.  Note this only works with
- * bison >= 2.0.  However, in bison 1.875 the default is to use alloca()
- * if possible, so there's not really much problem anyhow, at least if
- * you're building with gcc.
+ * memory s if we error out during parsing.
  */
 #define YYMALLOC palloc
 #define YYFREE   pfree
index 35a79ca965e7e91535cb184f2a47314148efc653..7e28853a57f65573453325e7205971bea968b9c6 100644 (file)
@@ -45,10 +45,7 @@ static JsonPathParseItem *makeItemLikeRegex(JsonPathParseItem *expr,
 /*
  * Bison doesn't allocate anything that needs to live across parser calls,
  * so we can easily have it use palloc instead of malloc.  This prevents
- * memory s if we error out during parsing.  Note this only works with
- * bison >= 2.0.  However, in bison 1.875 the default is to use alloca()
- * if possible, so there's not really much problem anyhow, at least if
- * you're building with gcc.
+ * memory s if we error out during parsing.
  */
 #define YYMALLOC palloc
 #define YYFREE   pfree
index 0b8aea95040e2c94e7e52bc51a5277722fe3a813..f7cf2b4b899a603c04786bd7cb2005109c3efdeb 100644 (file)
 /*
  * Bison doesn't allocate anything that needs to live across parser calls,
  * so we can easily have it use palloc instead of malloc.  This prevents
- * memory s if we error out during parsing.  Note this only works with
- * bison >= 2.0.  However, in bison 1.875 the default is to use alloca()
- * if possible, so there's not really much problem anyhow, at least if
- * you're building with gcc.
+ * memory s if we error out during parsing.
  */
 #define YYMALLOC palloc
 #define YYFREE   pfree
index 3974c30d96dcfa32f147ecc1049be17b5f41e8d1..60935adbaa790665225bcfe84fa55ef0468bc465 100644 (file)
@@ -16,7 +16,7 @@ do './src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl';
 my ($bisonver) = `bison -V`;    # grab first line
 $bisonver = (split(/\s+/, $bisonver))[3];    # grab version number
 
-unless ($bisonver eq '1.875' || $bisonver ge '2.2')
+unless ($bisonver ge '2.3')
 {
    print "WARNING! Bison install not found, or unsupported Bison version.\n";
    print "echo Attempting to build without.\n";