From 8d12a79c1840d81f8c157f29b83abb6b9f8b4aaf Mon Sep 17 00:00:00 2001 From: Frank Yang Date: Sat, 6 Apr 2019 11:12:26 +0800 Subject: [PATCH 01/11] Remove `dep` and `vendor` from `doc` and `version`. --- Makefile | 16 +++++---------- .../running-the-application.md | 1 - docs/gaia/installation.md | 1 - docs/translations/cn/gaia/installation.md | 1 - scripts/install/install_sdk_arm.sh | 1 - scripts/install/install_sdk_bsd.sh | 1 - scripts/install/install_sdk_ubuntu.sh | 1 - version/version.go | 20 ++++++++----------- 8 files changed, 13 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index 456f19cddf1e..a886806f2eff 100644 --- a/Makefile +++ b/Makefile @@ -47,10 +47,6 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags)" -ifneq ($(GOSUM),) -ldflags += -X github.com/cosmos/cosmos-sdk/version.VendorDirHash=$(shell $(GOSUM) go.sum) -endif - ifeq ($(WITH_CLEVELDB),yes) ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb endif @@ -121,8 +117,6 @@ draw_deps: tools clean: rm -rf snapcraft-local.yaml build/ -distclean: clean - rm -rf vendor/ ######################################## ### Documentation @@ -203,13 +197,13 @@ lint: tools ci-lint ci-lint: golangci-lint run go vet -composites=false -tests=false ./... - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s + find . -name '*.go' -type f -not -path "*.git*" | xargs gofmt -d -s go mod verify format: tools - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/cosmos/cosmos-sdk + find . -name '*.go' -type f -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s + find . -name '*.go' -type f -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w + find . -name '*.go' -type f -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/cosmos/cosmos-sdk benchmark: @go test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION) @@ -264,7 +258,7 @@ snapcraft-local.yaml: snapcraft-local.yaml.in # 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: install install_debug dist clean distclean \ +.PHONY: install install_debug dist clean \ draw_deps test test_cli test_unit \ test_cover lint benchmark devdoc_init devdoc devdoc_save devdoc_update \ build-linux build-docker-gaiadnode localnet-start localnet-stop \ diff --git a/docs/_attic/sdk/sdk-by-examples/simple-governance/running-the-application.md b/docs/_attic/sdk/sdk-by-examples/simple-governance/running-the-application.md index 3a057054d40a..e4acea34117d 100644 --- a/docs/_attic/sdk/sdk-by-examples/simple-governance/running-the-application.md +++ b/docs/_attic/sdk/sdk-by-examples/simple-governance/running-the-application.md @@ -7,7 +7,6 @@ Once you have finallized your application, install it using `go get`. The follow ```bash go get github.com//cosmos-sdk cd $GOPATH/src/github.com//cosmos-sdk -make get_vendor_deps make install make install_examples ``` diff --git a/docs/gaia/installation.md b/docs/gaia/installation.md index a3ce834ac09e..e44d52cfbff0 100644 --- a/docs/gaia/installation.md +++ b/docs/gaia/installation.md @@ -51,7 +51,6 @@ $ gaiacli version --long ``` cosmos-sdk: 0.33.0 git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0 -vendor hash: 5db0df3e24cf10545c84f462a24ddc61882aa58f build tags: netgo ledger go version go1.12 linux/amd64 ``` diff --git a/docs/translations/cn/gaia/installation.md b/docs/translations/cn/gaia/installation.md index 4c92fa2bebdf..0f4c3067696c 100644 --- a/docs/translations/cn/gaia/installation.md +++ b/docs/translations/cn/gaia/installation.md @@ -49,7 +49,6 @@ $ gaiacli version --long ``` cosmos-sdk: 0.33.0 git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0 -vendor hash: 5db0df3e24cf10545c84f462a24ddc61882aa58f build tags: netgo ledger go version go1.12 linux/amd64 ``` diff --git a/scripts/install/install_sdk_arm.sh b/scripts/install/install_sdk_arm.sh index ca00860918b3..d00f5fe16d96 100644 --- a/scripts/install/install_sdk_arm.sh +++ b/scripts/install/install_sdk_arm.sh @@ -32,7 +32,6 @@ cd $GOPATH/src/$REPO # build & install master git checkout $BRANCH LEDGER_ENABLED=false make tools -LEDGER_ENABLED=false make get_vendor_deps LEDGER_ENABLED=false make install source ~/.profile diff --git a/scripts/install/install_sdk_bsd.sh b/scripts/install/install_sdk_bsd.sh index 4784addc3e80..1db4062511f2 100644 --- a/scripts/install/install_sdk_bsd.sh +++ b/scripts/install/install_sdk_bsd.sh @@ -48,6 +48,5 @@ cd $GOPATH/src/$REPO # build & install master git checkout $BRANCH gmake tools -gmake get_vendor_deps gmake install gmake install_examples diff --git a/scripts/install/install_sdk_ubuntu.sh b/scripts/install/install_sdk_ubuntu.sh index dfd1e921a475..2f62fe4156b7 100644 --- a/scripts/install/install_sdk_ubuntu.sh +++ b/scripts/install/install_sdk_ubuntu.sh @@ -35,7 +35,6 @@ cd $GOPATH/src/$REPO # build & install master git checkout $BRANCH LEDGER_ENABLED=false make tools -LEDGER_ENABLED=false make get_vendor_deps LEDGER_ENABLED=false make install source ~/.profile diff --git a/version/version.go b/version/version.go index 0b2c09985a6f..d0b6eb097185 100644 --- a/version/version.go +++ b/version/version.go @@ -8,33 +8,29 @@ import ( // Variables set by build flags var ( - Commit = "" - Version = "" - VendorDirHash = "" - BuildTags = "" + Commit = "" + Version = "" + BuildTags = "" ) type versionInfo struct { - CosmosSDK string `json:"cosmos_sdk"` - GitCommit string `json:"commit"` - VendorDirHash string `json:"vendor_hash"` - BuildTags string `json:"build_tags"` - GoVersion string `json:"go"` + CosmosSDK string `json:"cosmos_sdk"` + GitCommit string `json:"commit"` + BuildTags string `json:"build_tags"` + GoVersion string `json:"go"` } func (v versionInfo) String() string { return fmt.Sprintf(`cosmos-sdk: %s git commit: %s -vendor hash: %s build tags: %s -%s`, v.CosmosSDK, v.GitCommit, v.VendorDirHash, v.BuildTags, v.GoVersion) +%s`, v.CosmosSDK, v.GitCommit, v.BuildTags, v.GoVersion) } func newVersionInfo() versionInfo { return versionInfo{ Version, Commit, - VendorDirHash, BuildTags, fmt.Sprintf("go version %s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH)} } From caedff83d72cd8e4878e73119d2c340c297040de Mon Sep 17 00:00:00 2001 From: Frank Yang Date: Sat, 6 Apr 2019 11:14:03 +0800 Subject: [PATCH 02/11] Remove `dep` and `vendor` from `doc` and `version`. --- .pending/improvements/gaia/4064-Remove-dep-and- | 1 + 1 file changed, 1 insertion(+) create mode 100644 .pending/improvements/gaia/4064-Remove-dep-and- diff --git a/.pending/improvements/gaia/4064-Remove-dep-and- b/.pending/improvements/gaia/4064-Remove-dep-and- new file mode 100644 index 000000000000..3792deb5405f --- /dev/null +++ b/.pending/improvements/gaia/4064-Remove-dep-and- @@ -0,0 +1 @@ +#4064 Remove `dep` and `vendor` from `doc` and `version`. \ No newline at end of file From c2b399228fca2ea5e3a5e841a8c62c89a483a139 Mon Sep 17 00:00:00 2001 From: Frank Yang Date: Sat, 6 Apr 2019 23:04:21 +0800 Subject: [PATCH 03/11] Replace vendor by gomod. --- Makefile | 12 ++++++++---- docs/gaia/installation.md | 1 + docs/translations/cn/gaia/installation.md | 1 + version/version.go | 6 +++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a886806f2eff..d7bc280f513a 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,10 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags)" +ifneq ($(GOSUM),) +ldflags += -X github.com/cosmos/cosmos-sdk/version.GoModHash=$(shell $(GOSUM) go.sum) +endif + ifeq ($(WITH_CLEVELDB),yes) ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb endif @@ -197,13 +201,13 @@ lint: tools ci-lint ci-lint: golangci-lint run go vet -composites=false -tests=false ./... - find . -name '*.go' -type f -not -path "*.git*" | xargs gofmt -d -s + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s go mod verify format: tools - find . -name '*.go' -type f -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s - find . -name '*.go' -type f -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w - find . -name '*.go' -type f -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/cosmos/cosmos-sdk + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/cosmos/cosmos-sdk benchmark: @go test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION) diff --git a/docs/gaia/installation.md b/docs/gaia/installation.md index e44d52cfbff0..2e5ad5a132b4 100644 --- a/docs/gaia/installation.md +++ b/docs/gaia/installation.md @@ -51,6 +51,7 @@ $ gaiacli version --long ``` cosmos-sdk: 0.33.0 git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0 +gomod hash: d156153bd5e128fec3868eca9a1397a63a864edb5cfa0ac486db1b574b8eecfe build tags: netgo ledger go version go1.12 linux/amd64 ``` diff --git a/docs/translations/cn/gaia/installation.md b/docs/translations/cn/gaia/installation.md index 0f4c3067696c..5699c8c5c05e 100644 --- a/docs/translations/cn/gaia/installation.md +++ b/docs/translations/cn/gaia/installation.md @@ -49,6 +49,7 @@ $ gaiacli version --long ``` cosmos-sdk: 0.33.0 git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0 +gomod hash: d156153bd5e128fec3868eca9a1397a63a864edb5cfa0ac486db1b574b8eecfe build tags: netgo ledger go version go1.12 linux/amd64 ``` diff --git a/version/version.go b/version/version.go index d0b6eb097185..15350dbca64e 100644 --- a/version/version.go +++ b/version/version.go @@ -10,12 +10,14 @@ import ( var ( Commit = "" Version = "" + GoModHash = "" BuildTags = "" ) type versionInfo struct { CosmosSDK string `json:"cosmos_sdk"` GitCommit string `json:"commit"` + GoModHash string `json:"gomod_hash"` BuildTags string `json:"build_tags"` GoVersion string `json:"go"` } @@ -23,14 +25,16 @@ type versionInfo struct { func (v versionInfo) String() string { return fmt.Sprintf(`cosmos-sdk: %s git commit: %s +gomod hash: %s build tags: %s -%s`, v.CosmosSDK, v.GitCommit, v.BuildTags, v.GoVersion) +%s`, v.CosmosSDK, v.GitCommit, v.GoModHash, v.BuildTags, v.GoVersion) } func newVersionInfo() versionInfo { return versionInfo{ Version, Commit, + GoModHash, BuildTags, fmt.Sprintf("go version %s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH)} } From c61a13124590729a901bf71bba073d856678a122 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sun, 7 Apr 2019 10:19:14 +0800 Subject: [PATCH 04/11] Update Makefile Co-Authored-By: yangyanqing --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d7bc280f513a..e539499dad75 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags)" ifneq ($(GOSUM),) -ldflags += -X github.com/cosmos/cosmos-sdk/version.GoModHash=$(shell $(GOSUM) go.sum) +ldflags += -X github.com/cosmos/cosmos-sdk/version.GoSumHash=$(shell $(GOSUM) go.sum) endif ifeq ($(WITH_CLEVELDB),yes) From be955089b5a9f0e6064e68fe739ff2f53fb67b81 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sun, 7 Apr 2019 10:19:25 +0800 Subject: [PATCH 05/11] Update docs/gaia/installation.md Co-Authored-By: yangyanqing --- docs/gaia/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/gaia/installation.md b/docs/gaia/installation.md index 2e5ad5a132b4..4bdd2954f981 100644 --- a/docs/gaia/installation.md +++ b/docs/gaia/installation.md @@ -51,7 +51,7 @@ $ gaiacli version --long ``` cosmos-sdk: 0.33.0 git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0 -gomod hash: d156153bd5e128fec3868eca9a1397a63a864edb5cfa0ac486db1b574b8eecfe +go.sum hash: d156153bd5e128fec3868eca9a1397a63a864edb5cfa0ac486db1b574b8eecfe build tags: netgo ledger go version go1.12 linux/amd64 ``` From d55867f04101301a2ad69f1f50f31b3c8078820f Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sun, 7 Apr 2019 10:19:39 +0800 Subject: [PATCH 06/11] Update version/version.go Co-Authored-By: yangyanqing --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index 15350dbca64e..3f14f854f857 100644 --- a/version/version.go +++ b/version/version.go @@ -17,7 +17,7 @@ var ( type versionInfo struct { CosmosSDK string `json:"cosmos_sdk"` GitCommit string `json:"commit"` - GoModHash string `json:"gomod_hash"` + GoSumHash string `json:"gosum_hash"` BuildTags string `json:"build_tags"` GoVersion string `json:"go"` } From 9327ca2474aa24def48540cdf7b92ed67544a736 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sun, 7 Apr 2019 10:19:45 +0800 Subject: [PATCH 07/11] Update version/version.go Co-Authored-By: yangyanqing --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index 3f14f854f857..ba3af650de11 100644 --- a/version/version.go +++ b/version/version.go @@ -27,7 +27,7 @@ func (v versionInfo) String() string { git commit: %s gomod hash: %s build tags: %s -%s`, v.CosmosSDK, v.GitCommit, v.GoModHash, v.BuildTags, v.GoVersion) +%s`, v.CosmosSDK, v.GitCommit, v.GoSumHash, v.BuildTags, v.GoVersion) } func newVersionInfo() versionInfo { From 1e055f2d9264b2135345cedd01127e28b64d75dc Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sun, 7 Apr 2019 10:20:07 +0800 Subject: [PATCH 08/11] Update version/version.go Co-Authored-By: yangyanqing --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index ba3af650de11..a2c3322f8e92 100644 --- a/version/version.go +++ b/version/version.go @@ -34,7 +34,7 @@ func newVersionInfo() versionInfo { return versionInfo{ Version, Commit, - GoModHash, + GoSumHash, BuildTags, fmt.Sprintf("go version %s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH)} } From b16ede8ca1d885cd0ef8bdf09a892f93e1d556b5 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sun, 7 Apr 2019 10:20:42 +0800 Subject: [PATCH 09/11] Update docs/translations/cn/gaia/installation.md Co-Authored-By: yangyanqing --- docs/translations/cn/gaia/installation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/translations/cn/gaia/installation.md b/docs/translations/cn/gaia/installation.md index 5699c8c5c05e..6a6214eeba98 100644 --- a/docs/translations/cn/gaia/installation.md +++ b/docs/translations/cn/gaia/installation.md @@ -49,7 +49,7 @@ $ gaiacli version --long ``` cosmos-sdk: 0.33.0 git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0 -gomod hash: d156153bd5e128fec3868eca9a1397a63a864edb5cfa0ac486db1b574b8eecfe +go.sum hash: d156153bd5e128fec3868eca9a1397a63a864edb5cfa0ac486db1b574b8eecfe build tags: netgo ledger go version go1.12 linux/amd64 ``` @@ -64,4 +64,4 @@ build tags指定了可执行程序具有的特殊特性。 | ledger | 支持Ledger设备(硬件钱包) | ### 接下来 -然后你可以选择 加入公共测试网 或是 创建私有测试网。 \ No newline at end of file +然后你可以选择 加入公共测试网 或是 创建私有测试网。 From 84ab0f60da1958fc67f1905511579427390f31a4 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sun, 7 Apr 2019 10:20:56 +0800 Subject: [PATCH 10/11] Update version/version.go Co-Authored-By: yangyanqing --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index a2c3322f8e92..278de195bef1 100644 --- a/version/version.go +++ b/version/version.go @@ -25,7 +25,7 @@ type versionInfo struct { func (v versionInfo) String() string { return fmt.Sprintf(`cosmos-sdk: %s git commit: %s -gomod hash: %s +go.sum hash: %s build tags: %s %s`, v.CosmosSDK, v.GitCommit, v.GoSumHash, v.BuildTags, v.GoVersion) } From f099f01ade8612c703b23332480ac913a40ef34b Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sun, 7 Apr 2019 10:21:07 +0800 Subject: [PATCH 11/11] Update version/version.go Co-Authored-By: yangyanqing --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index 278de195bef1..aad02d1904da 100644 --- a/version/version.go +++ b/version/version.go @@ -10,7 +10,7 @@ import ( var ( Commit = "" Version = "" - GoModHash = "" + GoSumHash = "" BuildTags = "" )