Failed to build YugaByte DB on CentOS 7.6

Following build guideline on github, while encounter below error when run below command. Any hints to fix this? Thanks a lot!

$ ./yb_build.sh release --with-assembly

[ 82%] Built target tablet_bootstrap-test
[build_postgres.py:360] 2018-12-14 09:24:31,714 INFO: Successfully ran configure in the postgres build directory
[build_postgres.py:167] 2018-12-14 09:24:31,716 INFO: Replaced cflags in /home/gpadmin/workspace/yugabyte-db/build/release-gcc-dynamic-community/postgres_build/src/Makefile.global
[build_postgres.py:427] 2018-12-14 09:24:41,776 INFO: Successfully ran make in the /home/gpadmin/workspace/yugabyte-db/build/release-gcc-dynamic-community/postgres_build directory

( cd “/home/gpadmin/workspace/yugabyte-db/build/release-gcc-dynamic-community/src/yb/yql/cql/ql/parser” && PATH=/home/gpadmin/.linuxbrew-yb-build/bin:$PATH /home/gpadmin/.linuxbrew-yb-build/bin/g++ -Dql_parser_EXPORTS -I/home/gpadmin/workspace/yugabyte-db/build/release-gcc-dynamic-community/src -I/home/gpadmin/workspace/yugabyte-db/src -isystem /home/gpadmin/.linuxbrew-yb-build/include -isystem /home/gpadmin/workspace/yugabyte-db/thirdparty/installed/uninstrumented/include -isystem /home/gpadmin/workspace/yugabyte-db/thirdparty/installed/common/include -Werror -fno-strict-aliasing -msse4.2 -Wall -Wno-sign-compare -Wno-deprecated -Winvalid-pch -pthread -DBOOST_BIND_NO_PLACEHOLDERS -DROCKSDB_PLATFORM_POSIX -march=ivybridge -mcx16 -DYB_COMPILER_TYPE=gcc -DYB_COMPILER_VERSION=5.5.0 -mno-avx -mno-bmi -mno-bmi2 -mno-fma -D__STDC_FORMAT_MACROS -Wno-deprecated-declarations -DGFLAGS=gflags -Wnon-virtual-dtor -Werror=enum-compare -Werror=reorder -Werror=switch -Werror=return-type -Werror=non-virtual-dtor -D_GLIBCXX_USE_CXX11_ABI=0 -DYB_HEADERS_NO_STUBS=1 -O3 -g -DNDEBUG -fno-omit-frame-pointer -mno-abm -mno-movbe -fPIC -DYB_EDITION_NS_PREFIX= -DTCMALLOC_ENABLED -O2 -DNDEBUG -fPIC -std=gnu++14 -Wno-tautological-undefined-compare -Wno-implicit-fallthrough -Wno-null-conversion -o CMakeFiles/ql_parser.dir/scanner_lex.l.cc.o -c /home/gpadmin/workspace/yugabyte-db/build/release-gcc-dynamic-community/src/yb/yql/cql/ql/parser/scanner_lex.l.cc -DYB_LOCAL_C_CXX_COMPILER_CMD ) # Compiler exit code: 1.

/-------------------------------------------------------------------------------

COMPILATION FAILED
scanner_lex.l: In member function ‘yb::ql::GramProcessor::symbol_type yb::ql::LexProcessor::yylex(const yb::ql::ScanState&)’:
scanner_lex.l:675:83: error: cannot bind ‘yb::ql::location’ lvalue to ‘yb::ql::GramProcessor::location_type&& {aka yb::ql::location&&}’
In file included from src/yb/yql/cql/ql/parser/scanner.h:42:0,
             from src/yb/yql/cql/ql/parser/parser.h:24,
             from scanner_lex.l:35:

build/release-gcc-dynamic-community/src/yb/yql/cql/ql/parser/parser_gram.y.hh:6128:3: note: initializing argument 2 of ‘yb::ql::GramProcessor::basic_symbol::basic_symbol(typename Base::kind_type, yb::ql::GramProcessor::location_type&&) [with Base = yb::ql::GramProcessor::by_type; typename Base::kind_type = yb::ql::GramProcessor::token::yytokentype; yb::ql::GramProcessor::location_type = yb::ql::location]’
GramProcessor::basic_symbol::basic_symbol (typename Base::kind_type t, location_type&& l)
^
scanner_lex.l:859:83: error: cannot bind ‘yb::ql::location’ lvalue to ‘yb::ql::GramProcessor::location_type&& {aka yb::ql::location&&}’
In file included from src/yb/yql/cql/ql/parser/scanner.h:42:0,
from src/yb/yql/cql/ql/parser/parser.h:24,
from scanner_lex.l:35:
build/release-gcc-dynamic-community/src/yb/yql/cql/ql/parser/parser_gram.y.hh:6128:3: note: initializing argument 2 of ‘yb::ql::GramProcessor::basic_symbol::basic_symbol(typename Base::kind_type, yb::ql::GramProcessor::location_type&&) [with Base = yb::ql::GramProcessor::by_type; typename Base::kind_type = yb::ql::GramProcessor::token::yytokentype; yb::ql::GramProcessor::location_type = yb::ql::location]’
GramProcessor::basic_symbol::basic_symbol (typename Base::kind_type t, location_type&& l)
^
scanner_lex.l:920:87: error: cannot bind ‘yb::ql::location’ lvalue to ‘yb::ql::GramProcessor::location_type&& {aka yb::ql::location&&}’
In file included from src/yb/yql/cql/ql/parser/scanner.h:42:0,
from src/yb/yql/cql/ql/parser/parser.h:24,
from scanner_lex.l:35:
build/release-gcc-dynamic-community/src/yb/yql/cql/ql/parser/parser_gram.y.hh:6128:3: note: initializing argument 2 of ‘yb::ql::GramProcessor::basic_symbol::basic_symbol(typename Base::kind_type, yb::ql::GramProcessor::location_type&&) [with Base = yb::ql::GramProcessor::by_type; typename Base::kind_type = yb::ql::GramProcessor::token::yytokentype; yb::ql::GramProcessor::location_type = yb::ql::location]’
GramProcessor::basic_symbol::basic_symbol (typename Base::kind_type t, location_type&& l)
^
scanner_lex.l:1021:72: error: cannot bind ‘yb::ql::location’ lvalue to ‘yb::ql::GramProcessor::location_type&& {aka yb::ql::location&&}’
In file included from src/yb/yql/cql/ql/parser/scanner.h:42:0,
from src/yb/yql/cql/ql/parser/parser.h:24,
from scanner_lex.l:35:
build/release-gcc-dynamic-community/src/yb/yql/cql/ql/parser/parser_gram.y.hh:6141:3: note: initializing argument 3 of ‘yb::ql::GramProcessor::basic_symbol::basic_symbol(typename Base::kind_type, const char*&&, yb::ql::GramProcessor::location_type&&) [with Base = yb::ql::GramProcessor::by_type; typename Base::kind_type = yb::ql::GramProcessor::token::yytokentype; yb::ql::KeywordType = const char*; yb::ql::GramProcessor::location_type = yb::ql::location]’
GramProcessor::basic_symbol::basic_symbol (typename Base::kind_type t, KeywordType&& v, location_type&& l)
^
scanner_lex.l:1031:83: error: cannot bind ‘yb::ql::location’ lvalue to ‘yb::ql::GramProcessor::location_type&& {aka yb::ql::location&&}’
In file included from src/yb/yql/cql/ql/parser/scanner.h:42:0,
from src/yb/yql/cql/ql/parser/parser.h:24,
from scanner_lex.l:35:
build/release-gcc-dynamic-community/src/yb/yql/cql/ql/parser/parser_gram.y.hh:6128:3: note: initializing argument 2 of ‘yb::ql::GramProcessor::basic_symbol::basic_symbol(typename Base::kind_type, yb::ql::GramProcessor::location_type&&) [with Base = yb::ql::GramProcessor::by_type; typename Base::kind_type = yb::ql::GramProcessor::token::yytokentype; yb::ql::GramProcessor::location_type = yb::ql::location]’
GramProcessor::basic_symbol::basic_symbol (typename Base::kind_type t, location_type&& l)
^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-null-conversion’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-implicit-fallthrough’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-tautological-undefined-compare’ [-Werror]
cc1plus: all warnings being treated as errors

Input files:
build/release-gcc-dynamic-community/src/yb/yql/cql/ql/parser/scanner_lex.l.cc
Output file (from -o): CMakeFiles/ql_parser.dir/scanner_lex.l.cc.o
-------------------------------------------------------------------------------
make[2]: *** [src/yb/yql/cql/ql/parser/CMakeFiles/ql_parser.dir/scanner_lex.l.cc.o] Error 1
make[1]: *** [src/yb/yql/cql/ql/parser/CMakeFiles/ql_parser.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[build_postgres.py:427] 2018-12-14 09:24:43,348 INFO: Successfully ran make in the /home/gpadmin/workspace/yugabyte-db/build/release-gcc-dynamic-community/postgres_build/contrib directory
[ 82%] Built target postgres
make: *** [all] Error 2

real 0m21.905s
user 0m54.035s
sys 0m19.049s
[2018-12-14T09:24:43 yb_build.sh:391 run_cxx_build] C++ build finished with exit code 2 (build type: release, compiler: gcc). Timing information is available above.

==========================================================================================
YUGABYTE BUILD SUMMARY

Build type : release
C/C++ compiler : gcc
Build directory : /home/gpadmin/workspace/yugabyte-db/build/release-gcc-dynamic-community
Edition : community
Third-party dir : /home/gpadmin/workspace/yugabyte-db/thirdparty
Linuxbrew dir : /home/gpadmin/.linuxbrew-yb-build
C++ compilation time : 22 seconds
Exit code : 2

Could you post the output of ~/.linuxbrew-yb-build/bin/brew list --versions?

Thanks for reporting this issue! It would be really useful for us to see the full build log.
I think this is most likely the Bison version issue. Currently our code builds with Bison 3.0.5. We are working on making our code work with the latest version of Bison (currently 3.2), as well as making “frozen” Linuxbrew distributions available, which will install exactly the same versions of third-party software (gcc, bison, etc.) that we use internally. The list of Linuxbrew-installed software versions we are currently using is:

autoconf 2.69
automake 1.16.1
berkeley-db@4 4.8.30
binutils 2.30
bison 3.0.5
bzip2 1.0.6_1
expat 2.2.5
flex 2.6.4
gcc 5.5.0_4
gdbm 1.15
gettext 0.19.8.1_1
glibc 2.23
gmp 6.1.2_2
gpatch 2.7.6
help2man 1.47.6
icu4c 61.1
isl 0.19
isl@0.18 0.18
libbsd 0.8.3
libffi 3.2.1
libmpc 1.1.0
libtool 2.4.6_2
libuuid 1.0.3
libxml2 2.9.7_1
linux-headers 4.4.80
m4 1.4.18
mpfr 4.0.1
ncurses 6.1
ninja 1.8.2_1
openssl 1.0.2o_2
patchelf 0.9_1
perl 5.26.2_1
pkg-config 0.29.2_1
python 3.6.5_1
python@2 2.7.15_1
readline 7.0.3_1
sphinx-doc 1.7.5_1
sqlite 3.24.0
unzip 6.0_3
xz 5.2.4
zlib 1.2.11

This issue has been reported on github. We’re working on it now.
The work around would be using an earlier version of BISON.

@zero - could you please try building with Bison 3.0.5 as a workaround?

Thanks for working on this. Here is my brew list --versions. bison version is 3.2.2.

○ → ~/.linuxbrew-yb-build/bin/brew list --versions
autoconf 2.69
automake 1.16.1_1
berkeley-db 18.1.25
binutils 2.31.1_2
bison 3.2.2
bzip2 1.0.6_1
curl 7.62.0
expat 2.2.6
flex 2.6.4
gcc 5.5.0_4
gdbm 1.18.1
gettext 0.19.8.1_1
git 2.19.2
glibc 2.23
gmp 6.1.2_2
gpatch 2.7.6
help2man 1.47.8
icu4c 63.1
isl@0.18 0.18
libbsd 0.8.3
libmpc 1.1.0
libtool 2.4.6_2
libuuid 1.0.3
linux-headers 4.4.80
m4 1.4.18
maven 3.6.0
mpfr 4.0.1
ncurses 6.1
openssl 1.0.2q
patchelf 0.9_1
pcre2 10.32
perl 5.28.0
pkg-config 0.29.2_1
readline 7.0.5
zlib 1.2.11

This issue with BISON 3.2.2 has been fixed.
For more information, please see