From 5d663437adbd9f91faf99eeb56aa9aec5170a8b5 Mon Sep 17 00:00:00 2001 From: baizg1107 Date: Mon, 11 Oct 2021 14:24:44 +0800 Subject: [PATCH] Fix release version not display --- 0001-fix-release-version.patch | 42 ++++++++++++++++++++++++++++++++++ tidb.spec | 6 ++++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 0001-fix-release-version.patch diff --git a/0001-fix-release-version.patch b/0001-fix-release-version.patch new file mode 100644 index 0000000..acf113e --- /dev/null +++ b/0001-fix-release-version.patch @@ -0,0 +1,42 @@ +From 3c62ba67a1cbb55636567909f6389e89fe6db7e8 Mon Sep 17 00:00:00 2001 +From: baizg1107 +Date: Mon, 11 Oct 2021 11:04:49 +0800 +Subject: [PATCH] fix release version + +--- + Makefile | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index c36dc47..24ec57e 100644 +--- a/Makefile ++++ b/Makefile +@@ -32,6 +32,10 @@ GOTEST := $(GO) test -p $(P) + OVERALLS := GO111MODULE=on overalls + STATICCHECK := GO111MODULE=on staticcheck + TIDB_EDITION ?= Community ++RELEASE_VERSION ?= v4.0.14 ++TIDB_BUILDTS ?= None ++TIDB_GITHASH ?= None ++TIDB_GITBRANCH ?= None + + # Ensure TIDB_EDITION is set to Community or Enterprise before running build process. + ifneq "$(TIDB_EDITION)" "Community" +@@ -51,10 +55,10 @@ FILES := $$(find $$($(PACKAGE_DIRECTORIES)) -name "*.go") + FAILPOINT_ENABLE := $$(find $$PWD/ -type d | grep -vE "(\.git|tools)" | xargs tools/bin/failpoint-ctl enable) + FAILPOINT_DISABLE := $$(find $$PWD/ -type d | grep -vE "(\.git|tools)" | xargs tools/bin/failpoint-ctl disable) + +-LDFLAGS += -X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=$(shell git describe --tags --dirty --always)" +-LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBBuildTS=$(shell date -u '+%Y-%m-%d %I:%M:%S')" +-LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBGitHash=$(shell git rev-parse HEAD)" +-LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBGitBranch=$(shell git rev-parse --abbrev-ref HEAD)" ++LDFLAGS += -X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=$(RELEASE_VERSION)" ++LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBBuildTS=$(TIDB_BUILDTS)" ++LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBGitHash=$(TIDB_GITHASH)" ++LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBGitBranch=$(TIDB_GITBRANCH)" + LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBEdition=$(TIDB_EDITION)" + + TEST_LDFLAGS = -X "github.com/pingcap/tidb/config.checkBeforeDropLDFlag=1" +-- +2.27.0 + diff --git a/tidb.spec b/tidb.spec index 4df804b..2ed12a4 100644 --- a/tidb.spec +++ b/tidb.spec @@ -1,6 +1,6 @@ Name: tidb Version: 4.0.14 -Release: 2 +Release: 3 Summary: TiDB is a distributed NewSQL database compatible with MySQL protocol License: QL and STRUTIL @@ -11,6 +11,7 @@ Source2: tidb-server.toml #Go mod for non-extranet environments Source3: vendor.tar.gz Patch0: Set-GOFLAG-to-go-mod-vendor.patch +Patch1: 0001-fix-release-version.patch BuildRequires: golang >= 1.10.0 Requires(pre): shadow-utils Requires(post): systemd @@ -68,6 +69,9 @@ exit 0 %license LICENSE %changelog +* Mon Oct 11 2021 baizhonggui - 4.0.14-3 +- Fix commond tidb-server -V 'Release Version' not displayed + * Thu Sep 02 2021 sunguoshuai - 4.0.14-2 - Fix tidb-server.service start failure -- Gitee