Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Switch package management to go modules #1

Merged
merged 3 commits into from
Jun 25, 2019
Merged

Conversation

austinabell
Copy link

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:

replace github.com/ethereum/go-ethereum v1.8.27 => github.com/alexanderbez/go-ethereum v1.8.17-0.20181024144731-0a57b29f0c8e

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).

@austinabell austinabell changed the title Austin/modules Switch package management to go modules Jun 21, 2019
@@ -19,32 +19,37 @@ DOCKER_TAG = unstable
DOCKER_IMAGE = cosmos/ethermint
ETHERMINT_DAEMON_BINARY = emintd
ETHERMINT_CLI_BINARY = emintcli
GO_MOD=GO111MODULE=on

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).

Copy link
Author

@austinabell austinabell Jun 24, 2019

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

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?

Copy link
Author

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.

Copy link

@GregTheGreek GregTheGreek left a 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

@austinabell austinabell merged commit 18d57af into master Jun 25, 2019
@austinabell austinabell deleted the austin/modules branch July 3, 2019 15:23
faddat added a commit to faddat/ethermint-1 that referenced this pull request Jun 5, 2021
…ions/cache-2.1.6

build(deps): bump actions/cache from 2.1.3 to 2.1.6
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants