-1

Initially posted this on the Ethereum forum but feel that there might be more knowledge of the issue here as it is a Golang/git package installation issue


I am trying to compile smart contracts using the go-ethereum client.

I have go installed on my pc and installed ran the following commands:

go get -u github.com/ethereum/go-ethereum 
cd $GOPATH/src/github.com/ethereum/go-ethereum/ 
make

Which all work fine.

When I run

make devtools

I get the following error:

Pros-MacBook-Pro:go-ethereum Santi$ make devtools
env GOBIN= go get -u golang.org/x/tools/cmd/stringer
# cd /Users/pro/go/src/golang.org/x/tools; git pull --ff-only
error: Your local changes to the following files would be overwritten by merge:
        CONTRIBUTING.md
        blog/blog.go
        cmd/godoc/autocert.go
        cmd/godoc/blog.go
        cmd/godoc/godoc_test.go
        cmd/godoc/handlers.go
        cmd/godoc/main.go
        cmd/godoc/x.go
        cmd/goimports/goimports.go
        cmd/gomvpkg/main.go
        cmd/goyacc/yacc.go
        cmd/guru/guru.go
        cmd/guru/guru_test.go
        cmd/guru/main.go
        cmd/guru/referrers.go
        cmd/guru/testdata/src/referrers/int_test.go
        cmd/guru/testdata/src/referrers/main.go
        cmd/guru/testdata/src/referrers/main.golden
        cmd/present/static/styles.css
        cmd/present/templates/slides.tmpl
        cmd/stringer/endtoend_test.go
        cmd/stringer/stringer.go
        cmd/tip/tip.go
        go/ast/astutil/imports.go
        go/ast/astutil/imports_test.go
        go/buildutil/allpackages_test.go
        go/buildutil/fakecontext.go
        go/buildutil/util_test.go
        go/gcexportdata/example_test.go
        go/gcexportdata/gcexportdata.go
        go/gcexportdata/main.go
        go/gcimporter15/bexport.go
        go/gcimporter15/bexport19_test.go
        go/gcimporter15/bexport_test.go
        go/gcimporter15/bimport.go
        go/gcimporter15/exportdata.go
        go/gcimporter15/gcimporter.go
        go/gcimporter15/gcimporter_test.go
        go/gcimporter15/isAlias18.go
        go/gcimporter15/isAlias19.go
        go/gcimporter15/testdata/a.go
        go/gcimporter15/testdata/b.go
        go/gcimporter15/testdata/exports.go
        go/gcimporter15/testdata/issue15920.go
        go/gcimporter15/testdata/issue20046.go
        go/gcimporter15/testdata/p.go
        go/gcimporter15/testdata/versions/test.go
        go/gcimporter15/testdata/versions/test_go1.7_0.a
        go/gcimporter15/testdata/versions/test_go1.7_1.a
        go/internal/gccgoimporter/gccgoinstallation_test.go
        go/internal/gccgoimporter/importer_test.go
        go/internal/gccgoimporter/parser.go
        go/loader/loader_test.go
        go/ssa/interp/external.go
        go/ssa/ssa.go
        go/vcs/vcs.go
        go/vcs/vcs_test.go
        godoc/cmdline.go
        godoc/cmdline_test.go
        godoc/dirtrees.go
        godoc/dl/dl.go
        godoc/godoc.go
        godoc/index.go
        godoc/pres.go
        godoc/server.go
        godoc/spec.go
        godoc/static/gen.go
        godoc/static/godoc.html
        godoc/static/godocs.js
        godoc/static/makestatic.go
        godoc/static/package.html
        godoc/static/playground.js
        godoc/static/static.go
        godoc/static/style.css
        godoc/template.go
        godoc/vfs/emptyvfs.go
        godoc/vfs/gatefs/gatefs.go
        godoc/vfs/mapfs/mapfs.go
        godoc/vfs/namespace.go
        godoc/vfs/os.go
        godoc/vfs/vfs.go
        godoc/vfs/zipfs/zipfs.go
        imports/fastwalk.go
        imports/fastwalk_dirent_fileno.go
        imports/fastwalk_dirent_ino.go
        imports/fastwalk_portable.go
        imports/fastwalk_test.go
        imports/fastwalk_unix.go
        imports/fix.go
        imports/fix_test.go
        imports/imports.go
        imports/sortimports.go
        present/parse.go
        refactor/eg/eg.go
        refactor/eg/eg_test.go
        refactor/eg/rewrite.go
        refactor/eg/testdata/no_after_return.template
        refactor/rename/rename.go
Please commit your changes or stash them before you merge.
Aborting
Updating 73e16cff..d74aaa1f
package golang.org/x/tools/cmd/stringer: exit status 1
make: *** [devtools] Error 1

Hoping that this wasnt too serious, I tries creating my go file with the following line:

abigen -abi=Store.abi --pkg=store --out=Store.go
bash: abigen: command not found

I suspect this has to do with my failed install and will appreciate any pointers on this

peterSO
  • 158,998
  • 31
  • 281
  • 276
0xsegfault
  • 2,899
  • 6
  • 28
  • 58

1 Answers1

0

I was able to solve this by doing the following:

  • cd /Users/pro/go/src/golang.org/x/tools (This is the repo that had the issues)
  • Run git stash save && git merge origin/master && git stash pop
  • Run make devtools (The make file contains the instructions for installing abigen and placing it in usr/bin

I got help from this answer:

How do I ignore an error on 'git pull' about my local changes would be overwritten by merge?

0xsegfault
  • 2,899
  • 6
  • 28
  • 58
  • You should not have changes in that directory at all. If you're using the upstream package, then your checkout should match that source. Keeping the modifications is only delaying problems for later. – JimB Jul 18 '18 at 14:36