From 9e7440a92c14187b05a3064864899f708a507d82 Mon Sep 17 00:00:00 2001 From: Frank Yang Date: Mon, 8 Apr 2019 23:00:17 +0800 Subject: [PATCH] Merge PR #4064: Remove dep/vendor from documentation and version cmd * Remove `dep` and `vendor` from documentation * Replace vendor with go.sum hash in version command --- .../improvements/gaia/4064-Remove-dep-and- | 1 + Makefile | 6 ++--- .../running-the-application.md | 1 - docs/gaia/installation.md | 2 +- docs/translations/cn/gaia/installation.md | 4 ++-- scripts/install/install_sdk_arm.sh | 1 - scripts/install/install_sdk_bsd.sh | 1 - scripts/install/install_sdk_ubuntu.sh | 1 - version/version.go | 24 +++++++++---------- 9 files changed, 18 insertions(+), 23 deletions(-) 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 000000000..3792deb54 --- /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 diff --git a/Makefile b/Makefile index 456f19cdd..e539499da 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.VendorDirHash=$(shell $(GOSUM) go.sum) +ldflags += -X github.com/cosmos/cosmos-sdk/version.GoSumHash=$(shell $(GOSUM) go.sum) endif ifeq ($(WITH_CLEVELDB),yes) @@ -121,8 +121,6 @@ draw_deps: tools clean: rm -rf snapcraft-local.yaml build/ -distclean: clean - rm -rf vendor/ ######################################## ### Documentation @@ -264,7 +262,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 3a057054d..e4acea341 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 a3ce834ac..4bdd2954f 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 -vendor hash: 5db0df3e24cf10545c84f462a24ddc61882aa58f +go.sum 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 4c92fa2be..6a6214eeb 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 -vendor hash: 5db0df3e24cf10545c84f462a24ddc61882aa58f +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 +然后你可以选择 加入公共测试网 或是 创建私有测试网。 diff --git a/scripts/install/install_sdk_arm.sh b/scripts/install/install_sdk_arm.sh index ca0086091..d00f5fe16 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 4784addc3..1db406251 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 dfd1e921a..2f62fe415 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 0b2c09985..aad02d190 100644 --- a/version/version.go +++ b/version/version.go @@ -8,33 +8,33 @@ import ( // Variables set by build flags var ( - Commit = "" - Version = "" - VendorDirHash = "" - BuildTags = "" + Commit = "" + Version = "" + GoSumHash = "" + 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"` + GoSumHash string `json:"gosum_hash"` + 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 +go.sum hash: %s build tags: %s -%s`, v.CosmosSDK, v.GitCommit, v.VendorDirHash, v.BuildTags, v.GoVersion) +%s`, v.CosmosSDK, v.GitCommit, v.GoSumHash, v.BuildTags, v.GoVersion) } func newVersionInfo() versionInfo { return versionInfo{ Version, Commit, - VendorDirHash, + GoSumHash, BuildTags, fmt.Sprintf("go version %s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH)} }