mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 13:55:17 +00:00
version: revert version through ldflag only (#6494)
## Description 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
This commit is contained in:
@@ -25,6 +25,8 @@ Friendly reminder: We have a [bug bounty program](https://hackerone.com/tendermi
|
|||||||
- [ABCI] \#5447 Remove `SetOption` method from `ABCI.Client` interface
|
- [ABCI] \#5447 Remove `SetOption` method from `ABCI.Client` interface
|
||||||
- [ABCI] \#5447 Reset `Oneof` indexes for `Request` and `Response`.
|
- [ABCI] \#5447 Reset `Oneof` indexes for `Request` and `Response`.
|
||||||
- [ABCI] \#5818 Use protoio for msg length delimitation. Migrates from int64 to uint64 length delimiters.
|
- [ABCI] \#5818 Use protoio for msg length delimitation. Migrates from int64 to uint64 length delimiters.
|
||||||
|
- [Version] \#6494 `TMCoreSemVer` has been renamed to `TMVersion`.
|
||||||
|
- It is not required any longer to set ldflags to set version strings
|
||||||
|
|
||||||
- P2P Protocol
|
- P2P Protocol
|
||||||
|
|
||||||
|
|||||||
@@ -245,6 +245,7 @@ If there were no release candidates, and you'd like to cut a major release direc
|
|||||||
all PRs
|
all PRs
|
||||||
- Ensure that UPGRADING.md is up-to-date and includes notes on any breaking changes
|
- Ensure that UPGRADING.md is up-to-date and includes notes on any breaking changes
|
||||||
or other upgrading flows.
|
or other upgrading flows.
|
||||||
|
- Bump TMVersionDefault version in `version.go`
|
||||||
- Bump P2P and block protocol versions in `version.go`, if necessary
|
- Bump P2P and block protocol versions in `version.go`, if necessary
|
||||||
- Bump ABCI protocol version in `version.go`, if necessary
|
- Bump ABCI protocol version in `version.go`, if necessary
|
||||||
- Add any release notes you would like to be added to the body of the release to `release_notes.md`.
|
- Add any release notes you would like to be added to the body of the release to `release_notes.md`.
|
||||||
@@ -272,6 +273,7 @@ If there were no release candidates, and you'd like to cut a major release direc
|
|||||||
release, and add the github aliases of external contributors to the top of
|
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>`
|
the changelog. To lookup an alias from an email, try `bash ./scripts/authors.sh <email>`
|
||||||
- Reset the `CHANGELOG_PENDING.md`
|
- Reset the `CHANGELOG_PENDING.md`
|
||||||
|
- Bump TMVersionDefault version in `version.go`
|
||||||
- Bump P2P and block protocol versions in `version.go`, if necessary
|
- Bump P2P and block protocol versions in `version.go`, if necessary
|
||||||
- Bump ABCI protocol version 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`
|
- Make sure all significant breaking changes are covered in `UPGRADING.md`
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -12,7 +12,7 @@ else
|
|||||||
VERSION := $(shell git describe)
|
VERSION := $(shell git describe)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LD_FLAGS = -X github.com/tendermint/tendermint/version.TMCoreSemVer=$(VERSION)
|
LD_FLAGS = -X github.com/tendermint/tendermint/version.TMVersion=$(VERSION)
|
||||||
BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)"
|
BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)"
|
||||||
HTTPS_GIT := https://github.com/tendermint/tendermint.git
|
HTTPS_GIT := https://github.com/tendermint/tendermint.git
|
||||||
DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf
|
DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ var VersionCmd = &cobra.Command{
|
|||||||
Use: "version",
|
Use: "version",
|
||||||
Short: "Show version info",
|
Short: "Show version info",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
fmt.Println(version.TMCoreSemVer)
|
fmt.Println(version.TMVersion)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ func doHandshake(
|
|||||||
func logNodeStartupInfo(state sm.State, pubKey crypto.PubKey, logger, consensusLogger log.Logger, mode string) {
|
func logNodeStartupInfo(state sm.State, pubKey crypto.PubKey, logger, consensusLogger log.Logger, mode string) {
|
||||||
// Log the version info.
|
// Log the version info.
|
||||||
logger.Info("Version info",
|
logger.Info("Version info",
|
||||||
"software", version.TMCoreSemVer,
|
"tmVersion", version.TMVersion,
|
||||||
"block", version.BlockProtocol,
|
"block", version.BlockProtocol,
|
||||||
"p2p", version.P2PProtocol,
|
"p2p", version.P2PProtocol,
|
||||||
"mode", mode,
|
"mode", mode,
|
||||||
@@ -704,7 +704,7 @@ func makeNodeInfo(
|
|||||||
),
|
),
|
||||||
NodeID: nodeKey.ID,
|
NodeID: nodeKey.ID,
|
||||||
Network: genDoc.ChainID,
|
Network: genDoc.ChainID,
|
||||||
Version: version.TMCoreSemVer,
|
Version: version.TMVersion,
|
||||||
Channels: []byte{
|
Channels: []byte{
|
||||||
bcChannel,
|
bcChannel,
|
||||||
byte(cs.StateChannel),
|
byte(cs.StateChannel),
|
||||||
@@ -753,7 +753,7 @@ func makeSeedNodeInfo(
|
|||||||
),
|
),
|
||||||
NodeID: nodeKey.ID,
|
NodeID: nodeKey.ID,
|
||||||
Network: genDoc.ChainID,
|
Network: genDoc.ChainID,
|
||||||
Version: version.TMCoreSemVer,
|
Version: version.TMVersion,
|
||||||
Channels: []byte{},
|
Channels: []byte{},
|
||||||
Moniker: config.Moniker,
|
Moniker: config.Moniker,
|
||||||
Other: p2p.NodeInfoOther{
|
Other: p2p.NodeInfoOther{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
// the abci.RequestInfo message during handshake with the app.
|
// the abci.RequestInfo message during handshake with the app.
|
||||||
// It contains only compile-time version information.
|
// It contains only compile-time version information.
|
||||||
var RequestInfo = abci.RequestInfo{
|
var RequestInfo = abci.RequestInfo{
|
||||||
Version: version.TMCoreSemVer,
|
Version: version.TMVersion,
|
||||||
BlockVersion: version.BlockProtocol,
|
BlockVersion: version.BlockProtocol,
|
||||||
P2PVersion: version.P2PProtocol,
|
P2PVersion: version.P2PProtocol,
|
||||||
AbciVersion: version.ABCIVersion,
|
AbciVersion: version.ABCIVersion,
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ var InitStateVersion = Version{
|
|||||||
Block: version.BlockProtocol,
|
Block: version.BlockProtocol,
|
||||||
App: 0,
|
App: 0,
|
||||||
},
|
},
|
||||||
Software: version.TMCoreSemVer,
|
Software: version.TMVersion,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *Version) ToProto() tmstate.Version {
|
func (v *Version) ToProto() tmstate.Version {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ func TestSyncer_SyncAny(t *testing.T) {
|
|||||||
Block: version.BlockProtocol,
|
Block: version.BlockProtocol,
|
||||||
App: 0,
|
App: 0,
|
||||||
},
|
},
|
||||||
Software: version.TMCoreSemVer,
|
Software: version.TMVersion,
|
||||||
},
|
},
|
||||||
|
|
||||||
LastBlockHeight: 1,
|
LastBlockHeight: 1,
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
extractKey(flagTMHome, flagKeyOutputPath)
|
extractKey(flagTMHome, flagKeyOutputPath)
|
||||||
case "version":
|
case "version":
|
||||||
fmt.Println(version.TMCoreSemVer)
|
fmt.Println(version.TMVersion)
|
||||||
default:
|
default:
|
||||||
fmt.Printf("Unrecognized command: %s\n", flag.Arg(0))
|
fmt.Printf("Unrecognized command: %s\n", flag.Arg(0))
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
@@ -3,12 +3,14 @@ package version
|
|||||||
import tmversion "github.com/tendermint/tendermint/proto/tendermint/version"
|
import tmversion "github.com/tendermint/tendermint/proto/tendermint/version"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// TMCoreSemVer is the current version of Tendermint Core.
|
TMVersion = TMVersionDefault
|
||||||
// It's the Semantic Version of the software.
|
|
||||||
TMCoreSemVer string
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
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 is the semantic version of the ABCI library
|
||||||
ABCISemVer = "0.17.0"
|
ABCISemVer = "0.17.0"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user