Go-ethereum: make geth fails Ubuntu 16.04 64bit go 1.9

Created on 26 Dec 2017  Â·  14Comments  Â·  Source: ethereum/go-ethereum

root@h2752422:~/go-ethereum# make geth
build/env.sh go run build/ci.go install ./cmd/geth
>>> /usr/local/go/bin/go install -ldflags -X main.gitCommit=9d187f02389ba12493112c7feb15a83f44e3a3ff -v ./cmd/geth
github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3
# github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3
In file included from vendor/gopkg.in/olebedev/go-duktape.v3/api.go:7:0:
vendor/gopkg.in/olebedev/go-duktape.v3/api.go: In function ‘_duk_error’:
vendor/gopkg.in/olebedev/go-duktape.v3/duktape.h:510:127: warning: right-hand operand of comma expression has no effect [-Wunused-value]
  (duk_error_raw((ctx), (duk_errcode_t) (err_code), (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__), (duk_ret_t) 0)
                                                                                                                               ^
vendor/gopkg.in/olebedev/go-duktape.v3/api.go:153:2: note: in expansion of macro ‘duk_error’
  duk_error(ctx, err_code, "%s", str);
  ^
# github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3
vendor/gopkg.in/olebedev/go-duktape.v3/duktape.go:132: constant 18446744073709551615 overflows int64
util.go:45: exit status 2
exit status 1
Makefile:15: recipe for target 'geth' failed
make: *** [geth] Error 1
root@h2752422:~/go-ethereum# go version
go version go1.9.1 linux/amd64
root@h2752422:~/go-ethereum# go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build854197436=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
root@h2752422:~/go-ethereum#

Most helpful comment

The problem is gone under go 1.9.2

All 14 comments

The same happens on macOS 10.13.2

I find a work around to solve this:
change line 192 of vendor/gopkg.in/olebedev/go-duktape.v3
from:
func (d *Context) PushCFunction(fn *[0]byte, nargs int64) int {
to:
func (d *Context) PushCFunction(fn *[0]byte, nargs uint64) int {

The reason seems go has problem in interpret an negative constant integer in C.

The problem is gone under go 1.9.2

Please consider closing this issue, upgrading to go1.9.2 fixes this problem.

build/env.sh go run build/ci.go install ./cmd/geth
ln: failed to create symbolic link 'go-ethereum/.': File exists
make: * [Makefile:15: geth] Error in Windows 10
Could someone plz help

I can also confirm the fix from @leo-xinwang -- upgrading to 1.9.2 fixes this issue.

I'm using go1.9.2 version only. Plz help

@Ajaysethi136 It seems like you just need to remove the existing symlink. Running this in the install location should work:
rm go-ethereum

Then run the build command again.

I tried removing but it throws the following error "rm: cannot remove 'go-ethereum': No such file or directory".
Currently, I'm using Windows 10, Might it causing be the issue?? or should we use Ubuntu only for this?

@leo-xinwang I`m sorry I did not know which file you mean.In my env go-duktape.v3 is a folder. and i find func (d *Context) PushCFunction(fn *[0]byte, nargs int64) int { in the 976 lines of vendor/gopkg.in/olebedev/go-duktape.v3/api.go and I change it to uint but still get the error vendor/gopkg.in/olebedev/go-duktape.v3/api.go:153:2: note: in expansion of macro ‘duk_error’
duk_error(ctx, err_code, "%s", str);

I am using ubuntu 16.04.1, go 1.10, geth 1.8.1 . I also see the same error, I have tried to modify to uint and it fails as follows:

user@ubuntu:~/go-ethereum-1.8.1$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial

user@ubuntu:~/go-ethereum-1.8.1$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/user/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/user/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build508432061=/tmp/go-build -gno-record-gcc-switches"

user@ubuntu:~/go-ethereum-1.8.1$ go version
go version go1.10 linux/amd64

user@ubuntu:~/go-ethereum-1.8.1$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.9' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 

user@ubuntu:~/go-ethereum-1.8.1$ make geth
build/env.sh go run build/ci.go install ./cmd/geth
>>> /usr/local/go/bin/go install -v ./cmd/geth
# github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3
In file included from vendor/gopkg.in/olebedev/go-duktape.v3/api.go:7:0:
vendor/gopkg.in/olebedev/go-duktape.v3/api.go: In function ‘_duk_error’:
vendor/gopkg.in/olebedev/go-duktape.v3/duktape.h:510:127: warning: right-hand operand of comma expression has no effect [-Wunused-value]
  (duk_error_raw((ctx), (duk_errcode_t) (err_code), (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__), (duk_ret_t) 0)
                                                                                                                               ^
vendor/gopkg.in/olebedev/go-duktape.v3/api.go:153:2: note: in expansion of macro ‘duk_error’
  duk_error(ctx, err_code, "%s", str);
  ^
Done building.
Run "/home/user/go-ethereum-1.8.1/build/bin/geth" to launch geth.
user@ubuntu:~/go-ethereum-1.8.1$

I did try 1.9.4 and it worked, but got the above as a warning only.

v1.9.2 worked for CentOS too.

The issue exists in go version go1.13.1 linux/amd64

Fix integrated in Geth with #20777

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AdrianScott picture AdrianScott  Â·  3Comments

prene picture prene  Â·  3Comments

cheershendtco picture cheershendtco  Â·  3Comments

bgrieder picture bgrieder  Â·  3Comments

phpsamsb picture phpsamsb  Â·  3Comments