Skip to content

Commit b086a47

Browse files
committed
Bump minimum version of Bison to 2.3
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/[email protected]
1 parent 96683db commit b086a47

File tree

13 files changed

+18
-42
lines changed

13 files changed

+18
-42
lines changed

config/programs.m4

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ fi
2222
# PGAC_PATH_BISON
2323
# ---------------
2424
# Look for Bison, set the output variable BISON to its path if found.
25-
# Reject versions before 1.875 (they have bugs or capacity limits).
26-
# Note we do not accept other implementations of yacc.
25+
# Reject versions before 2.3 (the earliest version in the buildfarm
26+
# as of 2022). Note we do not accept other implementations of yacc.
2727

2828
AC_DEFUN([PGAC_PATH_BISON],
2929
[PGAC_PATH_PROGS(BISON, bison)
3030
3131
if test "$BISON"; then
3232
pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
3333
AC_MSG_NOTICE([using $pgac_bison_version])
34-
if echo "$pgac_bison_version" | $AWK '{ if ([$]4 < 1.875) exit 0; else exit 1;}'
34+
if echo "$pgac_bison_version" | $AWK '{ if ([$]4 < 2.3) exit 0; else exit 1;}'
3535
then
3636
AC_MSG_WARN([
3737
*** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
38-
*** Bison version 1.875 or later is required, but this is $pgac_bison_version.])
38+
*** Bison version 2.3 or later is required, but this is $pgac_bison_version.])
3939
BISON=""
4040
fi
4141
# Bison >=3.0 issues warnings about %name-prefix="base_yy", instead

configure

+3-3
Original file line numberDiff line numberDiff line change
@@ -10218,14 +10218,14 @@ if test "$BISON"; then
1021810218
pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
1021910219
{ $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_bison_version" >&5
1022010220
$as_echo "$as_me: using $pgac_bison_version" >&6;}
10221-
if echo "$pgac_bison_version" | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'
10221+
if echo "$pgac_bison_version" | $AWK '{ if ($4 < 2.3) exit 0; else exit 1;}'
1022210222
then
1022310223
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
1022410224
*** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
10225-
*** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&5
10225+
*** Bison version 2.3 or later is required, but this is $pgac_bison_version." >&5
1022610226
$as_echo "$as_me: WARNING:
1022710227
*** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
10228-
*** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&2;}
10228+
*** Bison version 2.3 or later is required, but this is $pgac_bison_version." >&2;}
1022910229
BISON=""
1023010230
fi
1023110231
# Bison >=3.0 issues warnings about %name-prefix="base_yy", instead

contrib/cube/cubeparse.y

+1-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
/*
1616
* Bison doesn't allocate anything that needs to live across parser calls,
1717
* so we can easily have it use palloc instead of malloc. This prevents
18-
* memory leaks if we error out during parsing. Note this only works with
19-
* bison >= 2.0. However, in bison 1.875 the default is to use alloca()
20-
* if possible, so there's not really much problem anyhow, at least if
21-
* you're building with gcc.
18+
* memory leaks if we error out during parsing.
2219
*/
2320
#define YYMALLOC palloc
2421
#define YYFREE pfree

contrib/seg/segparse.y

+1-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
/*
1414
* Bison doesn't allocate anything that needs to live across parser calls,
1515
* so we can easily have it use palloc instead of malloc. This prevents
16-
* memory leaks if we error out during parsing. Note this only works with
17-
* bison >= 2.0. However, in bison 1.875 the default is to use alloca()
18-
* if possible, so there's not really much problem anyhow, at least if
19-
* you're building with gcc.
16+
* memory leaks if we error out during parsing.
2017
*/
2118
#define YYMALLOC palloc
2219
#define YYFREE pfree

doc/src/sgml/install-windows.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ $ENV{MSBFLAGS}="/m";
219219
<para>
220220
<productname>Bison</productname> and <productname>Flex</productname> are
221221
required to build from Git, but not required when building from a release
222-
file. Only <productname>Bison</productname> 1.875 or versions 2.2 and later
222+
file. Only <productname>Bison</productname> versions 2.3 and later
223223
will work. <productname>Flex</productname> must be version 2.5.31 or later.
224224
</para>
225225

doc/src/sgml/installation.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ su - postgres
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
317317
to get <application>Flex</application> 2.5.31 or later and
318-
<application>Bison</application> 1.875 or later. Other <application>lex</application>
318+
<application>Bison</application> 2.3 or later. Other <application>lex</application>
319319
and <application>yacc</application> programs cannot be used.
320320
</para>
321321
</listitem>

src/backend/bootstrap/bootparse.y

+1-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@
3636
/*
3737
* Bison doesn't allocate anything that needs to live across parser calls,
3838
* so we can easily have it use palloc instead of malloc. This prevents
39-
* memory leaks if we error out during parsing. Note this only works with
40-
* bison >= 2.0. However, in bison 1.875 the default is to use alloca()
41-
* if possible, so there's not really much problem anyhow, at least if
42-
* you're building with gcc.
39+
* memory leaks if we error out during parsing.
4340
*/
4441
#define YYMALLOC palloc
4542
#define YYFREE pfree

src/backend/parser/gram.y

+1-4
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@
103103
/*
104104
* Bison doesn't allocate anything that needs to live across parser calls,
105105
* so we can easily have it use palloc instead of malloc. This prevents
106-
* memory leaks if we error out during parsing. Note this only works with
107-
* bison >= 2.0. However, in bison 1.875 the default is to use alloca()
108-
* if possible, so there's not really much problem anyhow, at least if
109-
* you're building with gcc.
106+
* memory leaks if we error out during parsing.
110107
*/
111108
#define YYMALLOC palloc
112109
#define YYFREE pfree

src/backend/replication/repl_gram.y

+1-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ Node *replication_parse_result;
2929
/*
3030
* Bison doesn't allocate anything that needs to live across parser calls,
3131
* so we can easily have it use palloc instead of malloc. This prevents
32-
* memory leaks if we error out during parsing. Note this only works with
33-
* bison >= 2.0. However, in bison 1.875 the default is to use alloca()
34-
* if possible, so there's not really much problem anyhow, at least if
35-
* you're building with gcc.
32+
* memory leaks if we error out during parsing.
3633
*/
3734
#define YYMALLOC palloc
3835
#define YYFREE pfree

src/backend/replication/syncrep_gram.y

+1-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ static SyncRepConfigData *create_syncrep_config(const char *num_sync,
2626
/*
2727
* Bison doesn't allocate anything that needs to live across parser calls,
2828
* so we can easily have it use palloc instead of malloc. This prevents
29-
* memory leaks if we error out during parsing. Note this only works with
30-
* bison >= 2.0. However, in bison 1.875 the default is to use alloca()
31-
* if possible, so there's not really much problem anyhow, at least if
32-
* you're building with gcc.
29+
* memory leaks if we error out during parsing.
3330
*/
3431
#define YYMALLOC palloc
3532
#define YYFREE pfree

src/backend/utils/adt/jsonpath_gram.y

+1-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ static JsonPathParseItem *makeItemLikeRegex(JsonPathParseItem *expr,
4545
/*
4646
* Bison doesn't allocate anything that needs to live across parser calls,
4747
* so we can easily have it use palloc instead of malloc. This prevents
48-
* memory leaks if we error out during parsing. Note this only works with
49-
* bison >= 2.0. However, in bison 1.875 the default is to use alloca()
50-
* if possible, so there's not really much problem anyhow, at least if
51-
* you're building with gcc.
48+
* memory leaks if we error out during parsing.
5249
*/
5350
#define YYMALLOC palloc
5451
#define YYFREE pfree

src/pl/plpgsql/src/pl_gram.y

+1-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@
3939
/*
4040
* Bison doesn't allocate anything that needs to live across parser calls,
4141
* so we can easily have it use palloc instead of malloc. This prevents
42-
* memory leaks if we error out during parsing. Note this only works with
43-
* bison >= 2.0. However, in bison 1.875 the default is to use alloca()
44-
* if possible, so there's not really much problem anyhow, at least if
45-
* you're building with gcc.
42+
* memory leaks if we error out during parsing.
4643
*/
4744
#define YYMALLOC palloc
4845
#define YYFREE pfree

src/tools/msvc/pgbison.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
my ($bisonver) = `bison -V`; # grab first line
1717
$bisonver = (split(/\s+/, $bisonver))[3]; # grab version number
1818

19-
unless ($bisonver eq '1.875' || $bisonver ge '2.2')
19+
unless ($bisonver ge '2.3')
2020
{
2121
print "WARNING! Bison install not found, or unsupported Bison version.\n";
2222
print "echo Attempting to build without.\n";

0 commit comments

Comments
 (0)