-
Notifications
You must be signed in to change notification settings - Fork 161
Switch package management to go modules #1
Conversation
| DOCKER_IMAGE = cosmos/ethermint | ||
| ETHERMINT_DAEMON_BINARY = emintd | ||
| ETHERMINT_CLI_BINARY = emintcli | ||
| GO_MOD=GO111MODULE=on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to simplify this to GO111MODULE=on, with the additions below removed. Once its declared here it is within the scope of all the commands this file calls (eg. go build).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried this, doesn't work when GO111MODULE=on is not exported and code is run within the $GOPATH. I ran into this issue before and was very picky about being included before every go command which required the dependencies.
edit: here is the output:
~/go/src/github.com/cosmos/ethermint (austin/modules) $ make test-import
# github.com/cosmos/ethermint/importer
package github.com/cosmos/ethermint/importer (test)
imports github.com/cosmos/ethermint/x/evm/types
imports github.com/ethereum/go-ethereum/crypto/sha3: cannot find package "github.com/ethereum/go-ethereum/crypto/sha3" in any of:
/usr/local/Cellar/go/1.12.1/libexec/src/github.com/ethereum/go-ethereum/crypto/sha3 (from $GOROOT)
/Users/austinabell/go/src/github.com/ethereum/go-ethereum/crypto/sha3 (from $GOPATH)
FAIL github.com/cosmos/ethermint/importer [setup failed]
make: *** [test-import] Error 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to work for me if I just make this change:
GO111MODULE=on
GO_MOD=
Any chance you have GO111MODULE set on your machine already? Maybe in .bashrc or .profile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't work to just do this when run in $GOPATH, although is sufficient for running code outside of $GOPATH.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything make install & make build work on my machine with the following settings:
➜ ethermint git:(austin/modules) go version
go version go1.12.5 darwin/amd64
➜ ethermint git:(austin/modules) echo $GO111MODULE
on
…ions/cache-2.1.6 build(deps): bump actions/cache from 2.1.3 to 2.1.6
Previously used dep, but go modules is preferred since it removes the requirement of having to run code from the $GOPATH among other improvements.
Still uses Alexander's fork of go-ethereum with:
But we can research and discus how and what to replace this dependency with.
I didn't thoroughly check which makefile commands are nullified by this change so if you see something please let me know!
Also should looking into updating the cosmos sdk version, to update to their updated structure and functionality since the commit that is used as dependency (v0.28.0).