Fluent-bit: [OSX]Unable to build 1.2.2 in Xcode with"Command Yacc failed with a nonzero exit code"

Created on 24 Aug 2019  路  8Comments  路  Source: fluent/fluent-bit

Bug Report

Describe the bug

when build 1.2.2 and got this error:

Yacc /Users/gouyongchao/Documents/GitHub/fluent/fluent/fluent-bit-1.2.2/src/stream_processor/parser/sql.y (in target: fluent)
    cd /Users/gouyongchao/Documents/GitHub/fluent
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/yacc -d -b /Users/gouyongchao/Library/Developer/Xcode/DerivedData/fluent-bxurtvekhcnphtfiutfgpvzklodh/Build/Intermediates.noindex/fluent.build/Debug/fluent.build/DerivedSources/y /Users/gouyongchao/Documents/GitHub/fluent/fluent/fluent-bit-1.2.2/src/stream_processor/parser/sql.y

/Users/gouyongchao/Documents/GitHub/fluent/fluent/fluent-bit-1.2.2/src/stream_processor/parser/sql.y:1.9-16: syntax error, unexpected identifier, expecting string

Most helpful comment

Confirming this on OSX

...
[  6%] Built target onigmo
/Library/Developer/CommandLineTools/usr/bin/make -f src/record_accessor/CMakeFiles/flb-ra-parser.dir/build.make src/record_accessor/CMakeFiles/flb-ra-parser.dir/depend
[  6%] [BISON][parser] Building parser with bison 2.3
cd /Users/nigels/dev/fluent-bit/src/record_accessor && /usr/bin/bison -d -o /Users/nigels/dev/fluent-bit/build/src/record_accessor/ra_parser.c ra.y
ra.y:1.9-16: syntax error, unexpected identifier, expecting string
make[2]: *** [src/record_accessor/ra_parser.c] Error 1
make[1]: *** [src/record_accessor/CMakeFiles/flb-ra-parser.dir/all] Error 2
make: *** [all] Error 2

All 8 comments

Confirming this on OSX

...
[  6%] Built target onigmo
/Library/Developer/CommandLineTools/usr/bin/make -f src/record_accessor/CMakeFiles/flb-ra-parser.dir/build.make src/record_accessor/CMakeFiles/flb-ra-parser.dir/depend
[  6%] [BISON][parser] Building parser with bison 2.3
cd /Users/nigels/dev/fluent-bit/src/record_accessor && /usr/bin/bison -d -o /Users/nigels/dev/fluent-bit/build/src/record_accessor/ra_parser.c ra.y
ra.y:1.9-16: syntax error, unexpected identifier, expecting string
make[2]: *** [src/record_accessor/ra_parser.c] Error 1
make[1]: *** [src/record_accessor/CMakeFiles/flb-ra-parser.dir/all] Error 2
make: *** [all] Error 2

I managed to work around this problem via the brew bison:

export PATH=/usr/local/Cellar/bison/3.4.1/bin:$PATH
````

... but I run into other build issues also.

$ /usr/local/Cellar/bison/3.4.1/bin/bison --version
bison (GNU Bison) 3.4.1
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

@nigels-com Please write the issues that you are facing if it is not solved yet.

hmm so we basically need Bison >= 3.3

So far I've doing fluent bit development on a linux machine, today I tried using my Mac, and I got a similar issue (while trying to build the latest commit in master):

[ 34%] Built target mbedtls
[ 35%] [BISON][parser] Building parser with bison 2.3
ra.y:1.9-16: syntax error, unexpected identifier, expecting string
make[2]: *** [src/record_accessor/ra_parser.c] Error 1
make[1]: *** [src/record_accessor/CMakeFiles/flb-ra-parser.dir/all] Error 2
make: *** [all] Error 2

You'll need a newer bison than 2.3.

-- Found FLEX: /usr/bin/flex (found version "2.5.35")
-- Found BISON: /usr/local/opt/bison/bin/bison (found version "3.4.1")

I am getting the same issue post bison version upgrade to 3.7.2

%export PATH=/usr/local/Cellar/bison/3.7.2/bin:$PATH
% make
[ 1%] Built target backtrace
[ 2%] Built target jsmn
[ 2%] Built target sqlite3
[ 3%] Built target co
[ 4%] Built target rbtree
[ 5%] Built target xxd-c
[ 7%] Built target onigmo
[ 7%] [BISON][parser] Building parser with bison 2.3
ra.y:1.9-16: syntax error, unexpected identifier, expecting string
make[2]: * [src/record_accessor/ra_parser.c] Error 1
make[1]:
[src/record_accessor/CMakeFiles/flb-ra-parser.dir/all] Error 2
make: *
* [all] Error 2

@pratibhamoogi In case if you have upgraded bison, after you ran the cmake command in fluent-bit source, then you need to remove the content inside the build directory and and run the _cmake_ command again.

One way to verify that, there is a file called _CMakeCache.txt_ in _build_ directory and search following file path

BISON_EXECUTABLE:FILEPATH=/usr/local/bin/bison

I believe in your OS /usr/local/bin has the highest priority. You can check that by running

cat /etc/paths

Was this page helpful?
0 / 5 - 0 ratings