Issues Building with gccgo


#1

Hi all, I’m currently working on building the latest Couchbase master branch, but I seem to be having some issues with the Go dependency. I am on a system for which only gccgo (built from latest source) is available, not golang. According to the header in tlm/cmake/Modules/FindCouchbaseGo.cmake, building with gccgo should be possible, and the initial dependency check accepts it to fulfill the Go requirement. However, late in the compilation, I receive the following error:

Scanning dependencies of target n1ql-yacc
[100%] Executing: /opt/gccgo/bin/go tool yacc n1ql.y
go tool: no such tool "yacc"
make[4]: *** [../goproj/src/github.com/couchbase/query/parser/n1ql/y.go] Error 3
make[3]: *** [goproj/src/github.com/couchbase/query/CMakeFiles/n1ql-yacc.dir/all] Error 2
make[2]: *** [all] Error 2
make[1]: *** [compile] Error 2
make: *** [all] Error 2

This appears to occur during invocation of a macro in FindCouchbaseGo.cmake called GoYacc, which according to its comments cannot be run with gccgo, only golang. Assuming that the file’s main header is correct, and that compilation with gccgo is still possible, is there some flag that needs to be added in order to avoid the golang-only components?


#2

Hi, which platform is this so I can try to add it to my personal CI server and reproduce the problem?


#3

Thanks for the response! I’ve been working on building for RHEL 7.


#4

Ok, that I won’t set up @ home given that it requires a license… Btw. you should be able to build go by:

cd /usr/local
git clone https://go.googlesource.com/go
cd go
git checkout -b go1.4.2 go1.4.2
cd src
./all.bash
cd ../../bin
ln -s ../go/bin/go

And then build the stuff (at least that’s what I’ve done on my CentOS builder). I’ll see if I can find another system and set it up with gccgo.

Cheers,


#5

Thanks for the suggestion. Unfortunately, as I mentioned, golang isn’t an option on the target system; it doesn’t currently support the appropriate instruction set, whereas gcc does. As a note to follow on that, I have confirmed that the issue in question also crops up on a comparable x86-64 system, so it doesn’t appear to be related to the architecture.


#6

Just a note that I was able to solve the issue by separately downloading and installing yacc from https://raw.githubusercontent.com/golang/go/master/src/cmd/yacc/yacc.go, then adding the result to the appropriate spot in the gccgo directory. Might also be worth noting that, as per this discussion here: https://groups.google.com/forum/#!topic/golang-dev/990HVo40138, the Go community don’t seem to have much interest in adding yacc to gccgo by default, and in fact are proposing to move it out of the main golang repo as well.