Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
a1cdcf808a
!15 [sync] PR-14: Correct Tidb license
From: @openeuler-sync-bot 
Reviewed-by: @zhengzhenyu 
Signed-off-by: @zhengzhenyu
2024-12-12 05:39:33 +00:00
ZhengZhenyu
bf786d082a Correct Tidb license
Correct Tidb license

Signed-off-by: ZhengZhenyu <zheng.zhenyu@outlook.com>
(cherry picked from commit 5a164fe9516da82e981fb8167d6af790e43945a9)
2024-12-12 13:38:42 +08:00
openeuler-ci-bot
9058ac2634
!13 [sync] PR-12: add loong64 support
From: @openeuler-sync-bot 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2024-11-27 04:34:04 +00:00
zhangxianting
e62a5e4b05 add loong64 support
(cherry picked from commit 110e34f40893df25c1190a1dcd2b8c01bd3ffd67)
2024-11-24 07:54:07 +08:00
openeuler-ci-bot
0fefc3e6b3
!10 Add riscv64 support
From: @a-xiang-and-shanhaijing 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2023-07-19 08:10:30 +00:00
zhangxiang
35001aa01d add riscv support
add riscv support

add riscv support
2023-07-19 14:07:07 +08:00
openeuler-ci-bot
684c7c0487 !7 [sync] PR-6: Fix tidb-server -V 'Release Version' not displayed
From: @openeuler-sync-bot
Reviewed-by: @zhengzhenyu
Signed-off-by: @zhengzhenyu
2021-10-14 02:33:56 +00:00
baizg1107
788ba02213 Fix release version not display
(cherry picked from commit 5d663437adbd9f91faf99eeb56aa9aec5170a8b5)
2021-10-13 10:55:36 +08:00
openeuler-ci-bot
94fb4bcafb !3 [sync] PR-2: Fix tidb-server.service start failure
From: @openeuler-sync-bot
Reviewed-by: @bzhaoop
Signed-off-by: @bzhaoop
2021-09-03 02:28:36 +00:00
sunguoshuai
749050c2ed Fix tidb-server.service start failure
(cherry picked from commit d020f5dc74ea949c24f9a25ed7a2731f021e9f71)
2021-09-02 17:28:33 +08:00
6 changed files with 4201 additions and 6 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,42 @@
From 3c62ba67a1cbb55636567909f6389e89fe6db7e8 Mon Sep 17 00:00:00 2001
From: baizg1107 <preloyalwhite@163.com>
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

File diff suppressed because it is too large Load Diff

12
add-riscv-support.patch Normal file
View File

@ -0,0 +1,12 @@
diff -ur tidb-4.0.14/util/sys/linux/sys_linux.go tidb-4.0.14/util/sys/linux/sys_linux.go
--- tidb-4.0.14/util/sys/linux/sys_linux.go 2021-07-26 18:50:15.000000000 +0800
+++ tidb-4.0.14/util/sys/linux/sys_linux.go 2023-07-19 09:54:54.386949713 +0800
@@ -27,7 +27,7 @@
if err != nil {
return
}
- charsToString := func(ca []int8) string {
+ charsToString := func(ca []uint8) string {
s := make([]byte, len(ca))
var lens int
for ; lens < len(ca); lens++ {

View File

@ -7,8 +7,8 @@ Wants=network-online.target
User=mysql
Group=mysql
EnvironmentFile=-/etc/sysconfig/tidb-server
ExecStart=/usr/bin/tidb-server \$OPTIONS
ExecReload=/bin/kill -HUP \$MAINPID
ExecStart=/usr/bin/tidb-server $OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
Restart=on-failure
LimitNOFILE=65536

View File

@ -1,9 +1,9 @@
Name: tidb
Version: 4.0.14
Release: 1
Release: 5
Summary: TiDB is a distributed NewSQL database compatible with MySQL protocol
License: QL and STRUTIL
License: Apache 2.0
URL: https://github.com/pingcap/tidb
Source0: https://github.com/pingcap/tidb/archive/refs/tags/v4.0.14.tar.gz
Source1: tidb-server.service
@ -11,6 +11,13 @@ 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
%ifarch riscv64
Patch2: add-riscv-support.patch
Patch3: add-riscv-support-for-vendor.patch
%endif
Patch4: 0001-add-loong64-support.patch
BuildRequires: golang >= 1.10.0
Requires(pre): shadow-utils
Requires(post): systemd
@ -19,8 +26,23 @@ Requires(post): systemd
TiDB is a distributed NewSQL database compatible with MySQL protocol
%prep
%autosetup -p1
%ifarch riscv64
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
tar xvf %{SOURCE3} -C .
%patch3
%else
%setup -q
%patch0 -p1
%patch1 -p1
tar xvf %{SOURCE3} -C .
%ifarch loongarch64
%patch4 -p1
%endif
%endif
%build
%make_build
@ -40,6 +62,23 @@ cp %{SOURCE2} %{buildroot}%{_sysconfdir}/tidb
mkdir -p %{buildroot}%{_unitdir}
cp %{SOURCE1} %{buildroot}%{_unitdir}
%pre
# Add the "mysql" user
getent group mysql >/dev/null || groupadd -r -g 27 mysql
getent passwd mysql >/dev/null || useradd -r -u 27 -g 27 -s /sbin/nologin -d /var/lib/mysql mysql
exit 0
%post
%systemd_post tidb-server.service
/usr/bin/mkdir -p /var/lib/mysql
/usr/bin/chown -R mysql:mysql /var/lib/mysql
%preun
%systemd_preun tidb-server.service
%postun
%systemd_postun_with_restart tidb-server.service
%files
%{_bindir}/tidb-server
%{_unitdir}/tidb-server.service
@ -51,5 +90,17 @@ cp %{SOURCE1} %{buildroot}%{_unitdir}
%license LICENSE
%changelog
* Fri Aug 20 2021 huanghaitao <huanghaitao8@huawei.com>
* Mon Jul 01 2024 zhangxianting <zhangxianting@uniontech.com> - 4.0.14-5
- add loongarch64 support
* Mon Jul 17 2023 zhangxiang <zhangxiang@iscas.ac.cn> - 4.0.14-4
- add riscv64 support
* Mon Oct 11 2021 baizhonggui <baizhonggui@huawei.com> - 4.0.14-3
- Fix commond tidb-server -V 'Release Version' not displayed
* Thu Sep 02 2021 sunguoshuai <sunguoshuai@huawei.com> - 4.0.14-2
- Fix tidb-server.service start failure
* Fri Aug 20 2021 huanghaitao <huanghaitao8@huawei.com> - 4.0.14-1
- Package init