* version: revert version through ldflag only (#6494)

Add version back to versions, but allow it to be overridden via a ldflag.

Reason:

Many users are not setting the ldflag causing issues with tooling that relies on it (cosmjs)

closes #6488

cc @webmaster128

* revert variable rename

* Update CHANGELOG_PENDING.md
This commit is contained in:
Marko
2021-05-31 21:15:12 +00:00
committed by GitHub
parent 8dd8a4e8ea
commit c376b44f1c
6 changed files with 17 additions and 7 deletions

View File

@@ -12,6 +12,8 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
- Apps
- [Version] \#6494 `TMCoreSemVer` is not required to be set as a ldflag any longer.
- P2P Protocol
- Go API
@@ -26,4 +28,4 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
### BUG FIXES
- [evidence] \#6375 Fix bug with inconsistent LightClientAttackEvidence hashing (cmwaters)
- [evidence] \#6375 Fix bug with inconsistent LightClientAttackEvidence hashing (cmwaters)

View File

@@ -240,6 +240,7 @@ Each PR should have one commit once it lands on `master`; this can be accomplish
release, and add the github aliases of external contributors to the top of
the changelog. To lookup an alias from an email, try `bash ./scripts/authors.sh <email>`
- Reset the `CHANGELOG_PENDING.md`
- Bump TMVersionDefault version in `version.go`
- Bump P2P and block protocol versions in `version.go`, if necessary
- Bump ABCI protocol version in `version.go`, if necessary
- Make sure all significant breaking changes are covered in `UPGRADING.md`

View File

@@ -2,7 +2,14 @@ PACKAGES=$(shell go list ./...)
OUTPUT?=build/tendermint
BUILD_TAGS?=tendermint
VERSION := $(shell git describe --always)
# If building a release, please checkout the version tag to get the correct version setting
ifneq ($(shell git symbolic-ref -q --short HEAD),)
VERSION := unreleased-$(shell git symbolic-ref -q --short HEAD)-$(shell git rev-parse HEAD)
else
VERSION := $(shell git describe)
endif
LD_FLAGS = -X github.com/tendermint/tendermint/version.TMCoreSemVer=$(VERSION)
BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)"
HTTPS_GIT := https://github.com/tendermint/tendermint.git

View File

@@ -314,7 +314,7 @@ func doHandshake(
func logNodeStartupInfo(state sm.State, pubKey crypto.PubKey, logger, consensusLogger log.Logger) {
// Log the version info.
logger.Info("Version info",
"software", version.TMCoreSemVer,
"tendermint_version", version.TMCoreSemVer,
"block", version.BlockProtocol,
"p2p", version.P2PProtocol,
)

View File

@@ -50,7 +50,6 @@ func TestSyncer_SyncAny(t *testing.T) {
Block: version.BlockProtocol,
App: 0,
},
Software: version.TMCoreSemVer,
},

View File

@@ -1,12 +1,13 @@
package version
var (
// TMCoreSemVer is the current version of Tendermint Core.
// It's the Semantic Version of the software.
TMCoreSemVer string
TMCoreSemVer = TMVersionDefault
)
const (
// TMVersionDefault is the used as the fallback version of Tendermint Core
// when not using git describe. It is formatted with semantic versioning.
TMVersionDefault = "0.34.10"
// ABCISemVer is the semantic version of the ABCI library
ABCISemVer = "0.17.0"