diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 000000000000..0b6fe78734a2 --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,347 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + name = "github.com/btcsuite/btcd" + packages = ["btcec"] + revision = "50de9da05b50eb15658bb350f6ea24368a111ab7" + +[[projects]] + name = "github.com/davecgh/go-spew" + packages = ["spew"] + revision = "346938d642f2ec3594ed81d874461961cd0faa76" + version = "v1.1.0" + +[[projects]] + name = "github.com/fsnotify/fsnotify" + packages = ["."] + revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" + version = "v1.4.7" + +[[projects]] + name = "github.com/go-kit/kit" + packages = [ + "log", + "log/level", + "log/term" + ] + revision = "4dc7be5d2d12881735283bcab7352178e190fc71" + version = "v0.6.0" + +[[projects]] + name = "github.com/go-logfmt/logfmt" + packages = ["."] + revision = "390ab7935ee28ec6b286364bba9b4dd6410cb3d5" + version = "v0.3.0" + +[[projects]] + name = "github.com/go-stack/stack" + packages = ["."] + revision = "259ab82a6cad3992b4e21ff5cac294ccb06474bc" + version = "v1.7.0" + +[[projects]] + name = "github.com/gogo/protobuf" + packages = [ + "gogoproto", + "jsonpb", + "proto", + "protoc-gen-gogo/descriptor", + "sortkeys", + "types" + ] + revision = "1adfc126b41513cc696b209667c8656ea7aac67c" + version = "v1.0.0" + +[[projects]] + name = "github.com/golang/protobuf" + packages = [ + "proto", + "ptypes", + "ptypes/any", + "ptypes/duration", + "ptypes/timestamp" + ] + revision = "925541529c1fa6821df4e44ce2723319eb2be768" + version = "v1.0.0" + +[[projects]] + branch = "master" + name = "github.com/golang/snappy" + packages = ["."] + revision = "553a641470496b2327abcac10b36396bd98e45c9" + +[[projects]] + branch = "master" + name = "github.com/hashicorp/hcl" + packages = [ + ".", + "hcl/ast", + "hcl/parser", + "hcl/scanner", + "hcl/strconv", + "hcl/token", + "json/parser", + "json/scanner", + "json/token" + ] + revision = "23c074d0eceb2b8a5bfdbb271ab780cde70f05a8" + +[[projects]] + name = "github.com/inconshreveable/mousetrap" + packages = ["."] + revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" + version = "v1.0" + +[[projects]] + branch = "master" + name = "github.com/jmhodges/levigo" + packages = ["."] + revision = "c42d9e0ca023e2198120196f842701bb4c55d7b9" + +[[projects]] + branch = "master" + name = "github.com/kr/logfmt" + packages = ["."] + revision = "b84e30acd515aadc4b783ad4ff83aff3299bdfe0" + +[[projects]] + name = "github.com/magiconair/properties" + packages = ["."] + revision = "49d762b9817ba1c2e9d0c69183c2b4a8b8f1d934" + +[[projects]] + name = "github.com/mitchellh/mapstructure" + packages = ["."] + revision = "b4575eea38cca1123ec2dc90c26529b5c5acfcff" + +[[projects]] + name = "github.com/pelletier/go-toml" + packages = ["."] + revision = "acdc4509485b587f5e675510c4f2c63e90ff68a8" + version = "v1.1.0" + +[[projects]] + name = "github.com/pkg/errors" + packages = ["."] + revision = "645ef00459ed84a119197bfb8d8205042c6df63d" + version = "v0.8.0" + +[[projects]] + name = "github.com/pmezard/go-difflib" + packages = ["difflib"] + revision = "792786c7400a136282c1664665ae0a8db921c6c2" + version = "v1.0.0" + +[[projects]] + branch = "master" + name = "github.com/rigelrozanski/common" + packages = ["."] + revision = "f691f115798593d783b9999b1263c2f4ffecc439" + +[[projects]] + name = "github.com/spf13/afero" + packages = [ + ".", + "mem" + ] + revision = "bb8f1927f2a9d3ab41c9340aa034f6b803f4359c" + version = "v1.0.2" + +[[projects]] + name = "github.com/spf13/cast" + packages = ["."] + revision = "acbeb36b902d72a7a4c18e8f3241075e7ab763e4" + version = "v1.1.0" + +[[projects]] + name = "github.com/spf13/cobra" + packages = ["."] + revision = "7b2c5ac9fc04fc5efafb60700713d4fa609b777b" + version = "v0.0.1" + +[[projects]] + branch = "master" + name = "github.com/spf13/jwalterweatherman" + packages = ["."] + revision = "7c0cea34c8ece3fbeb2b27ab9b59511d360fb394" + +[[projects]] + name = "github.com/spf13/pflag" + packages = ["."] + revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66" + version = "v1.0.0" + +[[projects]] + name = "github.com/spf13/viper" + packages = ["."] + revision = "25b30aa063fc18e48662b86996252eabdcf2f0c7" + version = "v1.0.0" + +[[projects]] + name = "github.com/stretchr/testify" + packages = [ + "assert", + "require" + ] + revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71" + version = "v1.2.1" + +[[projects]] + name = "github.com/syndtr/goleveldb" + packages = [ + "leveldb", + "leveldb/cache", + "leveldb/comparer", + "leveldb/errors", + "leveldb/filter", + "leveldb/iterator", + "leveldb/journal", + "leveldb/memdb", + "leveldb/opt", + "leveldb/storage", + "leveldb/table", + "leveldb/util" + ] + revision = "34011bf325bce385408353a30b101fe5e923eb6e" + +[[projects]] + branch = "develop" + name = "github.com/tendermint/abci" + packages = [ + "server", + "types" + ] + revision = "c960c5275617ef141c92c3d7fc65a396c97662df" + +[[projects]] + branch = "master" + name = "github.com/tendermint/ed25519" + packages = [ + ".", + "edwards25519", + "extra25519" + ] + revision = "d8387025d2b9d158cf4efb07e7ebf814bcce2057" + +[[projects]] + branch = "develop" + name = "github.com/tendermint/go-crypto" + packages = ["."] + revision = "4fc3055dbd17aa1203d0abc64b9293f378da22ec" + +[[projects]] + branch = "develop" + name = "github.com/tendermint/go-wire" + packages = ["."] + revision = "5d7845f24b843c914cf571dad2ca13c91cf70f0d" + +[[projects]] + branch = "develop" + name = "github.com/tendermint/iavl" + packages = ["."] + revision = "1a59ec0c82dc940c25339dd7c834df5cb76a95cb" + +[[projects]] + branch = "develop" + name = "github.com/tendermint/tmlibs" + packages = [ + "cli", + "common", + "db", + "log", + "merkle" + ] + revision = "a0f652dc2e131be86fc8d9e4e2beec9831a8a6ec" + +[[projects]] + name = "golang.org/x/crypto" + packages = [ + "nacl/secretbox", + "openpgp/armor", + "openpgp/errors", + "poly1305", + "ripemd160", + "salsa20/salsa" + ] + revision = "1875d0a70c90e57f11972aefd42276df65e895b9" + +[[projects]] + name = "golang.org/x/net" + packages = [ + "context", + "http2", + "http2/hpack", + "idna", + "internal/timeseries", + "lex/httplex", + "trace" + ] + revision = "2fb46b16b8dda405028c50f7c7f0f9dd1fa6bfb1" + +[[projects]] + name = "golang.org/x/sys" + packages = ["unix"] + revision = "37707fdb30a5b38865cfb95e5aab41707daec7fd" + +[[projects]] + name = "golang.org/x/text" + packages = [ + "collate", + "collate/build", + "internal/colltab", + "internal/gen", + "internal/tag", + "internal/triegen", + "internal/ucd", + "language", + "secure/bidirule", + "transform", + "unicode/bidi", + "unicode/cldr", + "unicode/norm", + "unicode/rangetable" + ] + revision = "e19ae1496984b1c655b8044a65c0300a3c878dd3" + +[[projects]] + name = "google.golang.org/genproto" + packages = ["googleapis/rpc/status"] + revision = "4eb30f4778eed4c258ba66527a0d4f9ec8a36c45" + +[[projects]] + name = "google.golang.org/grpc" + packages = [ + ".", + "balancer", + "codes", + "connectivity", + "credentials", + "grpclb/grpc_lb_v1/messages", + "grpclog", + "internal", + "keepalive", + "metadata", + "naming", + "peer", + "resolver", + "stats", + "status", + "tap", + "transport" + ] + revision = "401e0e00e4bb830a10496d64cd95e068c5bf50de" + version = "v1.7.3" + +[[projects]] + name = "gopkg.in/yaml.v2" + packages = ["."] + revision = "d670f9405373e636a5a2765eea47fac0c9bc91a4" + version = "v2.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "74f3444e7f0d4ffdeb4454fbbf10064b2cb87f44a5b94cffd19fc6c459ddeef6" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 000000000000..f13991a61972 --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,70 @@ +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true + + +[[constraint]] + name = "github.com/golang/protobuf" + version = "1.0.0" + +[[constraint]] + name = "github.com/pkg/errors" + version = "0.8.0" + +[[constraint]] + branch = "master" + name = "github.com/rigelrozanski/common" + +[[constraint]] + name = "github.com/spf13/cobra" + version = "0.0.1" + +[[constraint]] + name = "github.com/stretchr/testify" + version = "1.2.1" + +[[constraint]] + branch = "develop" + name = "github.com/tendermint/abci" + +[[constraint]] + branch = "develop" + name = "github.com/tendermint/go-crypto" + +[[constraint]] + branch = "develop" + name = "github.com/tendermint/go-wire" + +[[constraint]] + branch = "develop" + name = "github.com/tendermint/iavl" + +[[constraint]] + branch = "develop" + name = "github.com/tendermint/tmlibs" + +[prune] + go-tests = true + unused-packages = true diff --git a/Makefile b/Makefile index 6c86730d0b2f..c5710ee5246d 100644 --- a/Makefile +++ b/Makefile @@ -31,15 +31,15 @@ check_tools: cd tools && $(MAKE) check update_tools: - cd tools && $(MAKE) glide_update + cd tools && $(MAKE) dep_update get_tools: cd tools && $(MAKE) get_vendor_deps: @rm -rf vendor/ - @echo "--> Running glide install" - @glide install + @echo "--> Running dep ensure" + @dep ensure draw_deps: @# requires brew install graphviz or apt-get install graphviz diff --git a/docs/sdk/install.rst b/docs/sdk/install.rst index 4857f63e79c9..c5a82475a315 100644 --- a/docs/sdk/install.rst +++ b/docs/sdk/install.rst @@ -13,7 +13,7 @@ Usually, Cosmos SDK can be installed like a normal Go program: go get -u github.com/cosmos/cosmos-sdk If the dependencies have been updated with breaking changes, or if -another branch is required, ``glide`` is used for dependency management. +another branch is required, ``dep`` is used for dependency management. Thus, assuming you've already run ``go get`` or otherwise cloned the repo, the correct way to install is: @@ -24,12 +24,12 @@ repo, the correct way to install is: make all This will create the ``basecoin`` binary in ``$GOPATH/bin``. -``make all`` implies ``make get_vendor_deps`` and uses ``glide`` to +``make all`` implies ``make get_vendor_deps`` and uses ``dep`` to install the correct version of all dependencies. It also tests the code, including some cli tests to make sure your binary behaves properly. If you need another branch, make sure to run ``git checkout `` before ``make all``. And if you switch branches a lot, especially touching other tendermint repos, you may need to ``make fresh`` -sometimes so glide doesn't get confused with all the branches and +sometimes so dep doesn't get confused with all the branches and versions lying around. diff --git a/docs/sdk/overview.rst b/docs/sdk/overview.rst index 25ed2b132b8e..300617ff4673 100644 --- a/docs/sdk/overview.rst +++ b/docs/sdk/overview.rst @@ -56,7 +56,7 @@ Strictly speaking, Golang does not implement object capabilities completely, bec * pervasive ability to override module vars https://github.com/golang/go/issues/23161 * data-race vulnerability where 2+ goroutines can create illegal interface values -The first is easy to catch by auditing imports and using a proper dependency version control system like Glide. The second and third are unfortunate but it can be audited with some cost. +The first is easy to catch by auditing imports and using a proper dependency version control system like Dep. The second and third are unfortunate but it can be audited with some cost. Perhaps `Go2 will implement the object capability model `__. diff --git a/examples/basecoin/Makefile b/examples/basecoin/Makefile index dac7dd213d79..3de8dc16a64a 100644 --- a/examples/basecoin/Makefile +++ b/examples/basecoin/Makefile @@ -1,11 +1,19 @@ PACKAGES=$(shell go list ./... | grep -v '/vendor/') BUILD_FLAGS = -ldflags "-X github.com/cosmos/cosmos-sdk/examples/basecoin/version.GitCommit=`git rev-parse --short HEAD`" -all: build test + +all: get_tools get_vendor_deps build test + +get_tools: + go get github.com/golang/dep/cmd/dep build: go build $(BUILD_FLAGS) -o build/basecoin ./cmd/... +get_vendor_deps: + @rm -rf vendor/ + @dep ensure + test: @go test $(PACKAGES) diff --git a/examples/basecoin/README.md b/examples/basecoin/README.md index ed667535deb5..520ae75d94c1 100644 --- a/examples/basecoin/README.md +++ b/examples/basecoin/README.md @@ -2,7 +2,18 @@ This is the "Basecoin" example application built on the Cosmos-SDK. This "Basecoin" is not affiliated with [Coinbase](http://www.getbasecoin.com/), nor the [stable coin](http://www.getbasecoin.com/). -Assuming you've run `make get_tools && make get_vendor_deps` from the root of this repository, -run `make build` here to build the `basecoind` and `basecli` binaries. +You need a recent version of `dep` to install Basecoin's dependencies. + +```bash +> make get_tools +``` + +Then, you can build the cmd binaries (NOTE: a work in progress!), or run the tests. + +``` +> make get_vendor_deps +> make build +> make test +``` If you want to create a new application, start by copying the Basecoin app. diff --git a/tools/Gopkg.lock b/tools/Gopkg.lock new file mode 100644 index 000000000000..ba42ba9bf97b --- /dev/null +++ b/tools/Gopkg.lock @@ -0,0 +1,15 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + branch = "master" + name = "github.com/rigelrozanski/common" + packages = ["."] + revision = "f691f115798593d783b9999b1263c2f4ffecc439" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "d94d5d70f00be97bb05e110d607c4d4de794e25111377b02078891bf494e38e1" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/tools/Gopkg.toml b/tools/Gopkg.toml new file mode 100644 index 000000000000..2e03fd48283c --- /dev/null +++ b/tools/Gopkg.toml @@ -0,0 +1,34 @@ +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true + + +[[constraint]] + branch = "master" + name = "github.com/rigelrozanski/common" + +[prune] + go-tests = true + unused-packages = true diff --git a/tools/Makefile b/tools/Makefile index 39611f305009..a030ef6eebe0 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,30 +1,30 @@ -all: install_glide check get_vendor_deps install +all: install_dep check get_vendor_deps install ######################################## -### Glide +### DEP -GLIDE = github.com/tendermint/glide -GLIDE_CHECK := $(shell command -v glide 2> /dev/null) +DEP = github.com/golang/dep/cmd/dep +DEP_CHECK := $(shell command -v dep 2> /dev/null) check: -ifndef GLIDE_CHECK - @echo "No glide in path. Install with 'make install_glide'." +ifndef DEP_CHECK + @echo "No dep in path. Install with 'make install_dep'." else - @echo "Found glide in path." + @echo "Found dep in path." endif -install_glide: -ifdef GLIDE_CHECK - @echo "Glide is already installed. Run 'make update_glide' to update." +install_dep: +ifdef DEP_CHECK + @echo "Dep is already installed. Run 'make update_dep' to update." else - @echo "$(ansi_grn)Installing glide$(ansi_end)" - go get -v $(GLIDE) + @echo "$(ansi_grn)Installing dep$(ansi_end)" + go get -v $(DEP) endif -update_glide: - @echo "$(ansi_grn)Updating glide$(ansi_end)" - go get -u -v $(GLIDE) +update_dep: + @echo "$(ansi_grn)Updating dep$(ansi_end)" + go get -u -v $(DEP) ######################################## @@ -33,8 +33,8 @@ update_glide: get_vendor_deps: check @rm -rf vendor/ - @echo "--> Running glide install" - @glide install + @echo "--> Running dep ensure" + @dep ensure install: get_vendor_deps @echo "$(ansi_grn)Installing tools$(ansi_end)" @@ -62,4 +62,4 @@ ansi_end=\033[0m # To avoid unintended conflicts with file names, always add to .PHONY # unless there is a reason not to. # https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html -.PHONY: check install_glide update_glide get_vendor_deps install +.PHONY: check install_dep update_dep get_vendor_deps install diff --git a/tools/main.go b/tools/main.go index 7fd61d589d6c..3993b4a042f3 100644 --- a/tools/main.go +++ b/tools/main.go @@ -1,10 +1,10 @@ package main import ( - // Include dependencies here so glide picks them up + // Include dependencies here so dep picks them up // and installs sub-dependencies. - // TODO: Ideally this gets auto-imported on glide update. + // TODO: Ideally this gets auto-imported on dep update. // Any way to make that happen? _ "github.com/rigelrozanski/common" )