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.
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.
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.
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.
Doesn't work to just do this when run in $GOPATH, although is sufficient for running code outside of $GOPATH.
…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).