Re: [nft PATCH v2] parser_bison: Fix for bison < 3.6
Eric Garver <[email protected]> Mon, 27 Jul 2026 08:18:57 -0400
| Newsgroups | gmane.comp.security.firewalls.netfilter.devel |
|---|---|
| Message-ID | <[email protected]> |
Hey Phil, I see a configure failure after this change [1] on ubuntu-24.04. ./configure: line 5247: syntax error near unexpected token `3.6,' ./configure: line 5247: ` AX_PROG_BISON_VERSION(3.6,' Error: Process completed with exit code 2. Does ax_prog_bison_version.m4 need to be added to the m4 directory? Thanks. E. [1]: https://github.com/firewalld/firewalld/actions/runs/30020547439/job/89969654992 On Thu, Jul 23, 2026 at 12:09:14PM +0200, Phil Sutter wrote: > On Thu, Jun 11, 2026 at 02:52:25PM +0200, Phil Sutter wrote: > > Support for 'custom' parse.error value was added in bison-3.6. Fall back > > to previous value for earlier versions. > > > > This is harder to get right than it seems: On one hand, preprocessor > > macros can't be used in parser_bison.y's declaration section and > > automake forbids conditional changes to AM_YFLAGS on the other. > > > > Another aspect complicating things is compiling with (an up to date) > > parser_bison.c in place vs. without: Dist tarballs generally have it in > > place, relieving users from having to provide a YACC when compiling. The > > existing parser_bison.c either uses parse.error=custom or not which does > > not (should not) change when compiling. Hiding yyreport_syntax_error() > > behind a CPPFLAG which may be set or not depending on bison presence and > > version then causes trouble if it doesn't match how parser_bison.c was > > created. > > > > Avoid these pitfalls by: > > - Not relying upon a preprocessor define to control parser_bison.c > > compilation, instead check existence of the bison-internal > > YY_LAC_ESTABLISH macro > > - Exporting the above macro existence check in a variable for use by > > main.c (thereby crossing the libnftables library boundary) > > > > Also: > > - Introduce have_prebuilt_bison variable in configure.ac, unifying the > > parser_bison.c existence check and solidify the latter by also > > comparing its timestamp > > - Report extended parser errors enableval in configure only if > > parser_bison.c will be recreated, otherwise we can't quite tell if it > > will turn out to be enabled or not > > > > Suggested-by: Jan Kończak <[email protected]> > > Fixes: 67b822f2b2624 ("parser_bison: on syntax errors, output expected tokens") > > Signed-off-by: Phil Sutter <[email protected]> > > Patch applied. >