Building query project from source

Hi,
I am trying to build locally the couchbase query project and I am getting a compilation error that I can’t figure out how to fix.
The environemnt I am using is Red-Hat 7.

I followed the instruction in the query github page (https://github.com/couchbase/query)

And got the following output:

[root@rhel7-64bit-6 query]# ./build.sh
go get -d -v ./...
github.com/couchbase/go_json (download)
github.com/couchbase/go-couchbase (download)
github.com/dustin/go-jsonpointer (download)
github.com/dustin/gojson (download)
github.com/andelf/go-curl (download)
github.com/couchbase/clog (download)
github.com/rcrowley/go-metrics (download)
github.com/couchbase/cbauth (download)
github.com/couchbase/gomemcached (download)
github.com/couchbase/goutils (download)
Fetching https://golang.org/x/crypto/pbkdf2?go-get=1
Parsing meta tags from https://golang.org/x/crypto/pbkdf2?go-get=1 (status code 200)
get "golang.org/x/crypto/pbkdf2": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/pbkdf2?go-get=1
get "golang.org/x/crypto/pbkdf2": verifying non-authoritative meta tag
Fetching https://golang.org/x/crypto?go-get=1
Parsing meta tags from https://golang.org/x/crypto?go-get=1 (status code 200)
golang.org/x/crypto (download)
github.com/gorilla/mux (download)
github.com/samuel/go-zookeeper (download)
github.com/couchbase/indexing (download)
github.com/couchbase/gometa (download)
github.com/golang/protobuf (download)
github.com/couchbase/retriever (download)
github.com/couchbase/godbc (download)
github.com/peterh/liner (download)
Fetching https://golang.org/x/sys/unix?go-get=1
Parsing meta tags from https://golang.org/x/sys/unix?go-get=1 (status code 200)
get "golang.org/x/sys/unix": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at https://golang.org/x/sys/unix?go-get=1
get "golang.org/x/sys/unix": verifying non-authoritative meta tag
Fetching https://golang.org/x/sys?go-get=1
Parsing meta tags from https://golang.org/x/sys?go-get=1 (status code 200)
golang.org/x/sys (download)
github.com/sbinet/liner (download)
github.com/russross/blackfriday (download)
cd parser/n1ql
goyacc n1ql.y
./build.sh: line 19: goyacc: command not found
go build
# github.com/couchbase/query/parser/n1ql
./n1ql.go:77:2: undefined: yyParse
./n1ql.go:98:30: undefined: yySymType
./n1ql.nn.go:31238:31: undefined: yySymType
./n1ql.nn.go:31250:13: undefined: _ERROR_
./n1ql.nn.go:31252:12: undefined: STR
./n1ql.nn.go:31262:13: undefined: _ERROR_
./n1ql.nn.go:31264:12: undefined: STR
./n1ql.nn.go:31277:13: undefined: _ERROR_
./n1ql.nn.go:31279:12: undefined: IDENT_ICASE
./n1ql.nn.go:31290:13: undefined: _ERROR_
./n1ql.nn.go:31290:13: too many errors
go fmt ./...
cd server/cbq-engine
go build
# github.com/couchbase/query/parser/n1ql
../../parser/n1ql/n1ql.go:77:2: undefined: yyParse
../../parser/n1ql/n1ql.go:98:30: undefined: yySymType
../../parser/n1ql/n1ql.nn.go:31238:31: undefined: yySymType
../../parser/n1ql/n1ql.nn.go:31250:13: undefined: _ERROR_
../../parser/n1ql/n1ql.nn.go:31252:12: undefined: STR
../../parser/n1ql/n1ql.nn.go:31262:13: undefined: _ERROR_
../../parser/n1ql/n1ql.nn.go:31264:12: undefined: STR
../../parser/n1ql/n1ql.nn.go:31277:13: undefined: _ERROR_
../../parser/n1ql/n1ql.nn.go:31279:12: undefined: IDENT_ICASE
../../parser/n1ql/n1ql.nn.go:31290:13: undefined: _ERROR_
../../parser/n1ql/n1ql.nn.go:31290:13: too many errors
cd shell/cbq.old
go build
cd shell/cbq
go build
cd tutorial
go build
go install ./...
# github.com/couchbase/query/parser/n1ql
parser/n1ql/n1ql.go:77:2: undefined: yyParse
parser/n1ql/n1ql.go:98:30: undefined: yySymType
parser/n1ql/n1ql.nn.go:31238:31: undefined: yySymType
parser/n1ql/n1ql.nn.go:31250:13: undefined: _ERROR_
parser/n1ql/n1ql.nn.go:31252:12: undefined: STR
parser/n1ql/n1ql.nn.go:31262:13: undefined: _ERROR_
parser/n1ql/n1ql.nn.go:31264:12: undefined: STR
parser/n1ql/n1ql.nn.go:31277:13: undefined: _ERROR_
parser/n1ql/n1ql.nn.go:31279:12: undefined: IDENT_ICASE
parser/n1ql/n1ql.nn.go:31290:13: undefined: _ERROR_
parser/n1ql/n1ql.nn.go:31290:13: too many errors

After that, I search for the goyacc package and downloaded it (https://github.com/cznic/goyacc)

[root@rhel7-64bit-6 query]# go get github.com/cznic/goyacc

And tried again to build and got the following errors:

[root@rhel7-64bit-6 query]# ./build.sh
go get -d -v ./...
cd parser/n1ql
goyacc n1ql.y
n1ql.y:148:8: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=IN) %!n(token.Pos=3115) %!n(int=11) [] %!n(string=) %!n(int=57413) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=262144) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=82) [] %!n(bool=false)}onassoc symbol %!s(int=130) conflict in state %!d(MISSING)
n1ql.y:148:8: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=IN) %!n(token.Pos=3115) %!n(int=11) [] %!n(string=) %!n(int=57413) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=262144) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=82) [] %!n(bool=false)}onassoc symbol %!s(int=131) conflict in state %!d(MISSING)
n1ql.y:148:8: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=IN) %!n(token.Pos=3115) %!n(int=11) [] %!n(string=) %!n(int=57413) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=262144) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=82) [] %!n(bool=false)}onassoc symbol %!s(int=137) conflict in state %!d(MISSING)
n1ql.y:148:8: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=IN) %!n(token.Pos=3115) %!n(int=11) [] %!n(string=) %!n(int=57413) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=262144) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=82) [] %!n(bool=false)}onassoc symbol %!s(int=138) conflict in state %!d(MISSING)
n1ql.y:168:8: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=LIKE) %!n(token.Pos=3377) %!n(int=9) [] %!n(string=) %!n(int=57433) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=8796093022208) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=107) [] %!n(bool=false)}onassoc symbol %!s(int=132) conflict in state %!d(MISSING)
n1ql.y:168:8: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=LIKE) %!n(token.Pos=3377) %!n(int=9) [] %!n(string=) %!n(int=57433) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=8796093022208) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=107) [] %!n(bool=false)}onassoc symbol %!s(int=139) conflict in state %!d(MISSING)
n1ql.y:252:8: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=WITHIN) %!n(token.Pos=4524) %!n(int=11) [] %!n(string=) %!n(int=57517) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=0) %!n(int=0) %!n(int=32768) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=207) [] %!n(bool=false)}onassoc symbol %!s(int=130) conflict in state %!d(MISSING)
n1ql.y:252:8: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=WITHIN) %!n(token.Pos=4524) %!n(int=11) [] %!n(string=) %!n(int=57517) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=0) %!n(int=0) %!n(int=32768) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=207) [] %!n(bool=false)}onassoc symbol %!s(int=131) conflict in state %!d(MISSING)
n1ql.y:252:8: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=WITHIN) %!n(token.Pos=4524) %!n(int=11) [] %!n(string=) %!n(int=57517) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=0) %!n(int=0) %!n(int=32768) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=207) [] %!n(bool=false)}onassoc symbol %!s(int=137) conflict in state %!d(MISSING)
n1ql.y:252:8: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=WITHIN) %!n(token.Pos=4524) %!n(int=11) [] %!n(string=) %!n(int=57517) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=0) %!n(int=0) %!n(int=32768) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=207) [] %!n(bool=false)}onassoc symbol %!s(int=138) conflict in state %!d(MISSING)
n1ql.y:268:17: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=EQ) %!n(token.Pos=4952) %!n(int=7) [] %!n(string=) %!n(int=57538) %!n(bool=false) %!n(bool=false) [%!n(int=36028797018963968) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=55) [] %!n(bool=false)}onassoc symbol %!s(int=179) conflict in state %!d(MISSING)
n1ql.y:268:17: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=EQ) %!n(token.Pos=4952) %!n(int=7) [] %!n(string=) %!n(int=57538) %!n(bool=false) %!n(bool=false) [%!n(int=36028797018963968) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=55) [] %!n(bool=false)}onassoc symbol %!s(int=180) conflict in state %!d(MISSING)
n1ql.y:268:17: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=EQ) %!n(token.Pos=4952) %!n(int=7) [] %!n(string=) %!n(int=57538) %!n(bool=false) %!n(bool=false) [%!n(int=36028797018963968) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=55) [] %!n(bool=false)}onassoc symbol %!s(int=181) conflict in state %!d(MISSING)
n1ql.y:268:20: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=DEQ) %!n(token.Pos=4955) %!n(int=7) [] %!n(string=) %!n(int=57539) %!n(bool=false) %!n(bool=false) [%!n(int=4398046511104) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=42) [] %!n(bool=false)}onassoc symbol %!s(int=179) conflict in state %!d(MISSING)
n1ql.y:268:20: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=DEQ) %!n(token.Pos=4955) %!n(int=7) [] %!n(string=) %!n(int=57539) %!n(bool=false) %!n(bool=false) [%!n(int=4398046511104) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=42) [] %!n(bool=false)}onassoc symbol %!s(int=180) conflict in state %!d(MISSING)
n1ql.y:268:20: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=DEQ) %!n(token.Pos=4955) %!n(int=7) [] %!n(string=) %!n(int=57539) %!n(bool=false) %!n(bool=false) [%!n(int=4398046511104) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=42) [] %!n(bool=false)}onassoc symbol %!s(int=181) conflict in state %!d(MISSING)
n1ql.y:268:24: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=NE) %!n(token.Pos=4959) %!n(int=7) [] %!n(string=) %!n(int=57540) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=288230376151711744) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=122) [] %!n(bool=false)}onassoc symbol %!s(int=179) conflict in state %!d(MISSING)
n1ql.y:268:24: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=NE) %!n(token.Pos=4959) %!n(int=7) [] %!n(string=) %!n(int=57540) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=288230376151711744) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=122) [] %!n(bool=false)}onassoc symbol %!s(int=180) conflict in state %!d(MISSING)
n1ql.y:268:24: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=NE) %!n(token.Pos=4959) %!n(int=7) [] %!n(string=) %!n(int=57540) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=288230376151711744) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=122) [] %!n(bool=false)}onassoc symbol %!s(int=181) conflict in state %!d(MISSING)
n1ql.y:269:17: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=LT) %!n(token.Pos=4978) %!n(int=8) [] %!n(string=) %!n(int=57541) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=140737488355328) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=111) [] %!n(bool=false)}onassoc symbol %!s(int=175) conflict in state %!d(MISSING)
n1ql.y:269:17: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=LT) %!n(token.Pos=4978) %!n(int=8) [] %!n(string=) %!n(int=57541) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=140737488355328) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=111) [] %!n(bool=false)}onassoc symbol %!s(int=176) conflict in state %!d(MISSING)
n1ql.y:269:17: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=LT) %!n(token.Pos=4978) %!n(int=8) [] %!n(string=) %!n(int=57541) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=140737488355328) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=111) [] %!n(bool=false)}onassoc symbol %!s(int=177) conflict in state %!d(MISSING)
n1ql.y:269:17: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=LT) %!n(token.Pos=4978) %!n(int=8) [] %!n(string=) %!n(int=57541) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=140737488355328) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=111) [] %!n(bool=false)}onassoc symbol %!s(int=178) conflict in state %!d(MISSING)
n1ql.y:269:20: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=GT) %!n(token.Pos=4981) %!n(int=8) [] %!n(string=) %!n(int=57542) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=2048) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=75) [] %!n(bool=false)}onassoc symbol %!s(int=175) conflict in state %!d(MISSING)
n1ql.y:269:20: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=GT) %!n(token.Pos=4981) %!n(int=8) [] %!n(string=) %!n(int=57542) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=2048) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=75) [] %!n(bool=false)}onassoc symbol %!s(int=176) conflict in state %!d(MISSING)
n1ql.y:269:20: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=GT) %!n(token.Pos=4981) %!n(int=8) [] %!n(string=) %!n(int=57542) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=2048) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=75) [] %!n(bool=false)}onassoc symbol %!s(int=177) conflict in state %!d(MISSING)
n1ql.y:269:20: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=GT) %!n(token.Pos=4981) %!n(int=8) [] %!n(string=) %!n(int=57542) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=2048) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=75) [] %!n(bool=false)}onassoc symbol %!s(int=178) conflict in state %!d(MISSING)
n1ql.y:269:23: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=LE) %!n(token.Pos=4984) %!n(int=8) [] %!n(string=) %!n(int=57543) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=549755813888) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=103) [] %!n(bool=false)}onassoc symbol %!s(int=175) conflict in state %!d(MISSING)
n1ql.y:269:23: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=LE) %!n(token.Pos=4984) %!n(int=8) [] %!n(string=) %!n(int=57543) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=549755813888) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=103) [] %!n(bool=false)}onassoc symbol %!s(int=176) conflict in state %!d(MISSING)
n1ql.y:269:23: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=LE) %!n(token.Pos=4984) %!n(int=8) [] %!n(string=) %!n(int=57543) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=549755813888) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=103) [] %!n(bool=false)}onassoc symbol %!s(int=177) conflict in state %!d(MISSING)
n1ql.y:269:23: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=LE) %!n(token.Pos=4984) %!n(int=8) [] %!n(string=) %!n(int=57543) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=549755813888) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=103) [] %!n(bool=false)}onassoc symbol %!s(int=178) conflict in state %!d(MISSING)
n1ql.y:269:26: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=GE) %!n(token.Pos=4987) %!n(int=8) [] %!n(string=) %!n(int=57544) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=128) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=71) [] %!n(bool=false)}onassoc symbol %!s(int=175) conflict in state %!d(MISSING)
n1ql.y:269:26: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=GE) %!n(token.Pos=4987) %!n(int=8) [] %!n(string=) %!n(int=57544) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=128) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=71) [] %!n(bool=false)}onassoc symbol %!s(int=176) conflict in state %!d(MISSING)
n1ql.y:269:26: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=GE) %!n(token.Pos=4987) %!n(int=8) [] %!n(string=) %!n(int=57544) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=128) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=71) [] %!n(bool=false)}onassoc symbol %!s(int=177) conflict in state %!d(MISSING)
n1ql.y:269:26: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=GE) %!n(token.Pos=4987) %!n(int=8) [] %!n(string=) %!n(int=57544) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=128) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=71) [] %!n(bool=false)}onassoc symbol %!s(int=178) conflict in state %!d(MISSING)
go build
can't load package: package github.com/couchbase/query/parser/n1ql:
y.go:1:1: expected 'package', found 'EOF'
go fmt ./...
can't load package: expression/parser/parser.go:17:2:
parser/n1ql/y.go:1:1: expected 'package', found 'EOF'
cd server/cbq-engine
go build
../../expression/parser/parser.go:17:2:
../../parser/n1ql/y.go:1:1: expected 'package', found 'EOF'
cd shell/cbq.old
go build
cd shell/cbq
go build
cd tutorial
go build
go install ./...
expression/parser/parser.go:17:2:
parser/n1ql/y.go:1:1: expected 'package', found 'EOF'
can't load package: expression/parser/parser.go:17:2:
parser/n1ql/y.go:1:1: expected 'package', found 'EOF'
[root@rhel7-64bit-6 query]#

Needless to say I did not change anything in the code. Can anyone help? Clues might help too.

Thanks in advance,
Eytan.

Hi Eytan,
Even I am seeing similar errors for “goyacc n1ql.y” command. No able to figure out the issue.
Were you able to resolve it or any pointers would really help.

I am working with couchbase master and go version 1.8.1.

Partial log of errors is as below:

n1ql.y:269:26: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=GE) %!n(token.Pos=4987) %!n(int=8) [] %!n(string=) %!n(int=57544) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=128) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=71) [] %!n(bool=false)}onassoc symbol %!s(int=176) conflict in state %!d(MISSING)
n1ql.y:269:26: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=GE) %!n(token.Pos=4987) %!n(int=8) [] %!n(string=) %!n(int=57544) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=128) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=71) [] %!n(bool=false)}onassoc symbol %!s(int=177) conflict in state %!d(MISSING)
n1ql.y:269:26: &{%!n(int=3) %!n(int=-1) %!n(bool=false) %!n(bool=false) %!n(bool=true) %!n(string=) %!n(string=GE) %!n(token.Pos=4987) %!n(int=8) [] %!n(string=) %!n(int=57544) %!n(bool=false) %!n(bool=false) [%!n(int=0) %!n(int=128) %!n(int=0) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(bool=true) [%!n(int=5836665134256227840) %!n(int=-5665492734476001279) %!n(int=36328963693412357) %!n(int=0) %!n(int=0) %!n(int=0)] %!n(int=71) [] %!n(bool=false)}onassoc symbol %!s(int=178) conflict in state %!d(MISSING)

Thanks,
Meghali

I haven’t solved it… I was working too on couchbase master with go version “go1.9 linux/amd64”

Never seen anything like that - but it seems to me that your goyacc is broken, given that it’s barfing on simple %token definitions.

I use goyacc from the golang/tools repository: https://github.com/golang/tools/tree/master/cmd/goyacc

Just get the whole of golang/tools (https://github.com/golang/tools) build the lot, and you should be fine.

HTH,
Marco

It seems to work - the query engine compiles successfully.

Thanks.

Thanks @marcog and @eytan.naim ; this helped me partially as of now.
I could get the goyacc source fetched from the URL mentioned; however it unable to list “yacc” as a go tool.

For me the error now:
go tool: no such tool “yacc”

‘go tool’ command doesn’t lists me this tool; I think I am missing something. Any pointers would help.

$ go tool
addr2line
asm
cgo
compile
cover
dist
doc
fix
link
nm
objdump
pack
pprof
tour
trace
vet

I am not dealing with this currently and I am not entirely familiar with golang either, but after installing the golang tools as marco suggested, I simply added the GOBIN dir to the PATH environemnt.

[root@rhel7-64bit-6 couchbase]# go env
GOARCH="amd64"
GOBIN="/root/projects/bin"
...

@dhoblem1 you are probably building 4.5 or 4.6.
These were coded to build with a go version earlier than 1.8, while 5.0 has been coded to be built with 1.8 or later.

This is key because up to 1.7, there indeed was a go tool named yacc, while 1.8 does not ship that any more and you have to install and build separate golang tools.

So to summarise, if you are building anything prior to 5.0, use go 1.7.
For 5.0, use 1.8.x and build golang tools.

1 Like

Hi @marcog,
I am using latest source for couchabase, which is 5.0.0 + version and hence I am using go version 1.8.1.
Thanks for the pointers; I need to check why my source is using “yacc” tool code if its not relevant with the couchbase latest code.

-Meghali

Hi Marco,
I observed in the couchbase 5.0.0 branch code as well the specific part of code is referring to the “yacc” tool.

MESSAGE (STATUS "Executing: ${GO_EXECUTABLE} tool yacc ${YFILE}")

Wondering how is this working for x86 setup as well.
-Meghali

I had to modify the above code by “goyacc” command instead of “go too yacc” as Go 1.8 and above does not support yacc too at all. Please refer the discussion at another thread at golang community for referece.

Thanks,
Meghali