facebookincubator/velox

Build fails by `%define variable 'api.parser.class' is not used`

Closed this issue · 7 comments

Problem description

Error:

cmake --build _build/release -j 4
[1/803] [FLEX][TypeCalculationScanner] Building scanner with flex 2.6.4
/work/velox/expression/type_calculation/TypeCalculation.ll:38: warning, -s option given but default rule can be matched
[2/803] [FLEX][TypeParserScanner] Building scanner with flex 2.6.4
/work/velox/type/parser/TypeParser.ll:68: warning, -s option given but default rule can be matched
[3/803] [FLEX][SignatureParserScanner] Building scanner with flex 2.6.4
/work/velox/expression/signature_parser/SignatureParser.ll:81: warning, -s option given but default rule can be matched
[4/803] [BISON][TypeCalculationParser] Building parser with bison 3.0.4
[5/803] Building CXX object velox/tpch/gen/dbgen/CMakeFiles/dbgen.dir/dbgen.cpp.o
[6/803] Building CXX object velox/tpch/gen/dbgen/CMakeFiles/dbgen.dir/dbgen_gunk.cpp.o
[7/803] Building CXX object velox/tpch/gen/dbgen/CMakeFiles/dbgen.dir/bm_utils.cpp.o
[8/803] [BISON][SignatureParser] Building parser with bison 3.0.4
FAILED: velox/expression/signature_parser/SignatureParser.yy.cc velox/expression/signature_parser/SignatureParser.yy.h /work/_build/release/velox/expression/signature_parser/SignatureParser.yy.cc /work/_build/release/velox/expression/signature_parser/SignatureParser.yy.h 
cd /work/_build/release/velox/expression/signature_parser && /usr/bin/bison -Werror -Wno-deprecated --defines=/work/_build/release/velox/expression/signature_parser/SignatureParser.yy.h -o /work/_build/release/velox/expression/signature_parser/SignatureParser.yy.cc /work/velox/expression/signature_parser/SignatureParser.yy
/work/velox/expression/signature_parser/SignatureParser.yy:10.9-24: error: %define variable 'api.parser.class' is not used
 %define api.parser.class {Parser}
         ^^^^^^^^^^^^^^^^
[9/803] [BISON][TypeParser] Building parser with bison 3.0.4
[10/803] Running PROTO compiler
[11/803] Building CXX object velox/tpch/gen/dbgen/CMakeFiles/dbgen.dir/build.cpp.o
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:112: build] Error 1
make[1]: Leaving directory '/work'
make: *** [Makefile:119: release] Error 2

Reason

This is because the parser class name definition %define api.parser.class {Parser} introduced in PR #14675 is not supported by bison version 3.0.4 (which is the Velox's default bison version). It requires minimal bison version 3.8 3.3.

System information

Velox System Info v0.0.2
Commit: 19aa8abf72c1f0b914eb14a4a9f47b99d8163730
CMake Version: 3.28.3
System: Linux-6.14.0-29-generic
Arch: aarch64
C++ Compiler: /usr/bin/c++
C++ Compiler Version: 11.4.0
C Compiler: /usr/bin/cc
C Compiler Version: 11.4.0
CMake Prefix Path: /usr/local;/usr;/;/root/.local/share/uv/tools/cmake/lib/python3.12/site-packages/cmake/data;/usr/local;/usr/X11R6;/usr/pkg;/opt

@furmak331 @mbasmanova

Can we have a quick fix for this? Will it be fine if we simple use the old fashion %define parser_class_name {Parser} instead? Thanks.

MBkkt commented

Maybe we need follow up issue about update minimal bison? To avoid deprecated syntax?

Introduced in Bison 3.3 to replace parser_class_name

Maybe we need follow up issue about update minimal bison? To avoid deprecated syntax?

+1. Either to bump the bison version or to cover 3.0.4 in CI.

Let's bump the bison version. I see my homebrew has Cellar/bison/3.8.2. So it will not impact any developer setups.
We can update CI versions where needed.

Sorry , i thought its fine like that . i wasnt aware it would throw an error . I will take care from next time. Thank you for fixing it .

@furmak331 No worries at all. Such regression happens when we don't have something in CI to cover the code. That's not anyone's fault.