Browse Source

Backport: #6494 (#6506)

* 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
pull/6528/head
Marko 3 years ago
committed by GitHub
parent
commit
c376b44f1c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 7 deletions
  1. +3
    -1
      CHANGELOG_PENDING.md
  2. +1
    -0
      CONTRIBUTING.md
  3. +8
    -1
      Makefile
  4. +1
    -1
      node/node.go
  5. +0
    -1
      statesync/syncer_test.go
  6. +4
    -3
      version/version.go

+ 3
- 1
CHANGELOG_PENDING.md 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)

+ 1
- 0
CONTRIBUTING.md 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`


+ 8
- 1
Makefile 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


+ 1
- 1
node/node.go 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,
)


+ 0
- 1
statesync/syncer_test.go View File

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


+ 4
- 3
version/version.go 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"


Loading…
Cancel
Save