From c68a9ff1cfb6bff6663640674ea89aa398eb2a94 Mon Sep 17 00:00:00 2001 From: Juan Leni Date: Tue, 12 Feb 2019 11:54:09 +0100 Subject: [PATCH 1/6] Indicate build flags in version --- Makefile | 12 ++++++++---- version/version.go | 12 +++++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index b8cdbbed85f4..70a7df2142e0 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,6 @@ VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') COMMIT := $(shell git log -1 --format='%H') BUILD_TAGS = netgo CAT := $(if $(filter $(OS),Windows_NT),type,cat) -BUILD_FLAGS = -tags "${BUILD_TAGS}" -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.VendorDirHash=$(shell $(CAT) vendor-deps)" LEDGER_ENABLED ?= true GOTOOLS = \ github.com/golang/dep/cmd/dep \ @@ -51,6 +47,14 @@ ifeq ($(LEDGER_ENABLED),true) endif endif +### Update Build flags +BUILD_FLAGS = -tags "${BUILD_TAGS}" -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.VendorDirHash=$(shell $(CAT) vendor-deps) \ + -X "github.com/cosmos/cosmos-sdk/version.BuildTags=${BUILD_TAGS}"' + + build: ifeq ($(OS),Windows_NT) go build $(BUILD_FLAGS) -o build/gaiad.exe ./cmd/gaia/cmd/gaiad diff --git a/version/version.go b/version/version.go index 6affcfbd4978..4d36b392f1f9 100644 --- a/version/version.go +++ b/version/version.go @@ -11,12 +11,14 @@ var ( Commit = "" Version = "" VendorDirHash = "" + BuildTags = "" ) type versionInfo struct { CosmosSDK string `json:"cosmos_sdk"` GitCommit string `json:"commit"` VendorDirHash string `json:"vendor_hash"` + BuildTags string `json:"tags"` GoVersion string `json:"go"` } @@ -24,11 +26,15 @@ func (v versionInfo) String() string { return fmt.Sprintf(`cosmos-sdk: %s git commit: %s vendor hash: %s -%s`, v.CosmosSDK, v.GitCommit, v.VendorDirHash, v.GoVersion) +build tags: %s +%s`, v.CosmosSDK, v.GitCommit, v.VendorDirHash, v.BuildTags, v.GoVersion) } func newVersionInfo() versionInfo { return versionInfo{ - Version, Commit, VendorDirHash, fmt.Sprintf("go version %s %s/%s\n", - runtime.Version(), runtime.GOOS, runtime.GOARCH)} + Version, + Commit, + VendorDirHash, + BuildTags, + fmt.Sprintf("go version %s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH)} } From 86b79081598ef426a4e48adc314078e77579a4a1 Mon Sep 17 00:00:00 2001 From: Juan Leni Date: Tue, 12 Feb 2019 12:04:06 +0100 Subject: [PATCH 2/6] updating pending.md --- PENDING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PENDING.md b/PENDING.md index a41bbe0ca3d8..28daa24ef61f 100644 --- a/PENDING.md +++ b/PENDING.md @@ -34,6 +34,9 @@ IMPROVEMENTS * Gaia * SDK + * [\#3604] Improve SDK funds related error messages and allow for unicode in + JSON ABCI log. + * [\#3620](https://github.com/cosmos/cosmos-sdk/pull/3620) Version command shows build tags * Tendermint * [\#3618] Upgrade to Tendermint 0.30.03 From 8510f52535dc30a0ddfabf5b6db2c69980586589 Mon Sep 17 00:00:00 2001 From: Juan Leni Date: Tue, 12 Feb 2019 12:05:06 +0100 Subject: [PATCH 3/6] adjusting json name --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index 4d36b392f1f9..0b2c09985a6f 100644 --- a/version/version.go +++ b/version/version.go @@ -18,7 +18,7 @@ type versionInfo struct { CosmosSDK string `json:"cosmos_sdk"` GitCommit string `json:"commit"` VendorDirHash string `json:"vendor_hash"` - BuildTags string `json:"tags"` + BuildTags string `json:"build_tags"` GoVersion string `json:"go"` } From 1fba7308fa226e971964cd6baad9527d4b51d9fc Mon Sep 17 00:00:00 2001 From: Juan Leni Date: Tue, 12 Feb 2019 12:07:12 +0100 Subject: [PATCH 4/6] replacing spaces with tabs (alignment) --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 70a7df2142e0..b884db42e76a 100644 --- a/Makefile +++ b/Makefile @@ -49,9 +49,9 @@ endif ### Update Build flags BUILD_FLAGS = -tags "${BUILD_TAGS}" -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.VendorDirHash=$(shell $(CAT) vendor-deps) \ + '-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.VendorDirHash=$(shell $(CAT) vendor-deps) \ -X "github.com/cosmos/cosmos-sdk/version.BuildTags=${BUILD_TAGS}"' From fcc744eab11263ecbae2eda7f2b65f3726751a62 Mon Sep 17 00:00:00 2001 From: Juan Leni Date: Wed, 13 Feb 2019 06:49:05 +0100 Subject: [PATCH 5/6] Moving back to original place --- Makefile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index b884db42e76a..0b8c041a9dbc 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,11 @@ VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') COMMIT := $(shell git log -1 --format='%H') BUILD_TAGS = netgo CAT := $(if $(filter $(OS),Windows_NT),type,cat) +BUILD_FLAGS = -tags "$(BUILD_TAGS)" -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.VendorDirHash=$(shell $(CAT) vendor-deps) \ + -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(BUILD_TAGS)"' LEDGER_ENABLED ?= true GOTOOLS = \ github.com/golang/dep/cmd/dep \ @@ -47,14 +52,6 @@ ifeq ($(LEDGER_ENABLED),true) endif endif -### Update Build flags -BUILD_FLAGS = -tags "${BUILD_TAGS}" -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.VendorDirHash=$(shell $(CAT) vendor-deps) \ - -X "github.com/cosmos/cosmos-sdk/version.BuildTags=${BUILD_TAGS}"' - - build: ifeq ($(OS),Windows_NT) go build $(BUILD_FLAGS) -o build/gaiad.exe ./cmd/gaia/cmd/gaiad From d9ad0bca5bd7a48531ffb198be5296cfbc2cb682 Mon Sep 17 00:00:00 2001 From: Juan Leni Date: Wed, 13 Feb 2019 07:20:32 +0100 Subject: [PATCH 6/6] Adding a comment to installation.md --- docs/gaia/installation.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/gaia/installation.md b/docs/gaia/installation.md index 84b4f92697bd..af2791750542 100644 --- a/docs/gaia/installation.md +++ b/docs/gaia/installation.md @@ -36,10 +36,29 @@ make tools install That will install the `gaiad` and `gaiacli` binaries. Verify that everything is OK: ```bash -$ gaiad version -$ gaiacli version +$ gaiad version --long +$ gaiacli version --long ``` +`gaiacli` for instance should output something similar to: + +``` +cosmos-sdk: 0.31.2-10-g1fba7308 +git commit: 1fba7308fa226e971964cd6baad9527d4b51d9fc +vendor hash: 1aec7edfad9888a967b3e9063e42f66b28f447e6 +build tags: netgo ledger +go version go1.11.5 linux/amd64 +``` + +##### Build Tags + +Build tags indicate special features that have been enabled in the binary. + +| Build Tag | Description | +| --------- | ----------------------------------------------- | +| netgo | Name resolution will use pure Go code | +| ledger | Ledger devices are supported (hardware wallets) | + ### Next Now you can [join the public testnet](./join-testnet.md) or [create you own testnet](./deploy-testnet.md)