Compare commits

..

11 Commits

Author SHA1 Message Date
openeuler-ci-bot
b7631721b6
!59 fix build error when custom vendor
From: @xiaochn 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2024-12-05 08:24:52 +00:00
xiaochuannan
b0573f51cb fix build error when custom vendor 2024-11-11 17:55:36 +08:00
openeuler-ci-bot
ebf398433b
!33 同步2203修改PR到master和2403分支,拉齐主干分支版本
From: @zhang_xubo 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2024-04-28 03:45:27 +00:00
zhang_xubo
0084fbccda fix version 2024-04-26 21:40:30 +08:00
panchenbo
4f9bb33e1f fix changelog version error and add sw_64 support
(cherry picked from commit 8f5d326c86b373c08fc03aae9d002b8b31f256d3)
2024-04-26 21:08:48 +08:00
陈棋德
18f4b4012c update opengauss-server.spec.
Signed-off-by: 陈棋德 <dillon.chen@gmail.com>
(cherry picked from commit 7288b50b7f5c148944a284ee9768438e08d099bc)
2024-04-26 21:05:48 +08:00
panchenbo
a3cb9997f7 add /etc/kylinsec-release support for KylinSec
(cherry picked from commit 637a6c9123fe9230ea28709d061f7dd453bc15b1)
2024-04-26 21:02:06 +08:00
ouyanglearnning
f93eefc569 add kylinsec platform
(cherry picked from commit 09fba82cd66e031435a20c69f457e89cde8bd090)
2024-04-26 20:59:55 +08:00
zhang_xubo
aaa7918a97 Fixed ease of use issues
(cherry picked from commit e77658c53bdf09c7ddf842e9bc2a6ee98ee8f1f4)
2024-04-26 20:58:24 +08:00
openeuler-ci-bot
69c8c7394b
!28 修复在openEuler2309上编译错误
From: @zhang_xubo 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2023-08-14 05:48:17 +00:00
zhang_xubo
d2f93ae4ff fix compile error in openeuler2309 branch 2023-08-14 10:38:07 +08:00
6 changed files with 2028 additions and 12 deletions

View File

@ -0,0 +1,82 @@
From 58207338fe6b98b5eee54757d99e40f8621e0f04 Mon Sep 17 00:00:00 2001
From: panchenbo <panchenbo@kylinsec.com.cn>
Date: Mon, 10 Apr 2023 10:15:12 +0800
Subject: [PATCH] add support for KylinSec platform
---
.../build/script/package_opengauss.sh | 10 ++++++----
openGauss-server-2.1.0/src/get_PlatForm_str.sh | 13 +++++++++++++
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/openGauss-server-2.1.0/build/script/package_opengauss.sh b/openGauss-server-2.1.0/build/script/package_opengauss.sh
index f6447b2..8b82cb1 100755
--- a/openGauss-server-2.1.0/build/script/package_opengauss.sh
+++ b/openGauss-server-2.1.0/build/script/package_opengauss.sh
@@ -62,10 +62,12 @@ elif [ X"$kernel" == X"euleros" ]; then
dist_version="EulerOS"
elif [ X"$kernel" == X"kylin" ]; then
dist_version="Kylin"
+elif [ X"$kernel" == X"kylinsec" ]; then
+ dist_version="KylinSec"
elif [ X"$kernel" = X"ubuntu" ]; then
dist_version="Ubuntu"
else
- echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64) and Ubuntu(x86) platform."
+ echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64), KylinSec(aarch64) and Ubuntu(x86) platform."
echo "Kernel is $kernel"
exit 1
fi
@@ -122,8 +124,8 @@ done
##add platform architecture information
PLATFORM_ARCH=$(uname -p)
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
- if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] ; then
- echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64) platform."
+ if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] && [ "$dist_version" != "KylinSec" ] ; then
+ echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64), KylinSec(aarch64) platform."
exit 1
fi
@@ -220,7 +222,7 @@ ROOT_DIR=$(dirname "$ROOT_DIR")
PLAT_FORM_STR=$(sh "${ROOT_DIR}/src/get_PlatForm_str.sh")
if [ "${PLAT_FORM_STR}"x == "Failed"x ]
then
- echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64) platform."
+ echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64), KylinSec(aarch64) platform."
exit 1;
fi
diff --git a/openGauss-server-2.1.0/src/get_PlatForm_str.sh b/openGauss-server-2.1.0/src/get_PlatForm_str.sh
index 9fff29a..ce73a9c 100755
--- a/openGauss-server-2.1.0/src/get_PlatForm_str.sh
+++ b/openGauss-server-2.1.0/src/get_PlatForm_str.sh
@@ -29,6 +29,9 @@ then
elif [ -f "/etc/kylin-release" ]
then
kernel=$(cat /etc/kylin-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
+elif [ -f "/etc/kylinsec-release" ]
+then
+ kernel=$(cat /etc/kylinsec-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
else
kernel=$(lsb_release -d | awk -F ' ' '{print $2}'| tr A-Z a-z)
fi
@@ -135,6 +138,16 @@ then
plat_form_str=kylin_"$cpu_bit"
fi
+##################################################################################
+# kylinsec platform
+# the result form like this: kylinsec_aarch64
+##################################################################################
+if [ "$kernel"x = "kylinsec"x ]
+then
+ plat_form_str=kylinsec_"$cpu_bit"
+fi
+
+
##################################################################################
# ubuntu platform
# the result form like this: ubuntu_x86_64
--
2.27.0

View File

@ -0,0 +1,38 @@
diff -Naur a/openGauss-server-2.1.0/build/script/package_opengauss.sh b/openGauss-server-2.1.0/build/script/package_opengauss.sh
--- a/openGauss-server-2.1.0/build/script/package_opengauss.sh 2024-11-06 09:45:40.281917930 +0800
+++ b/openGauss-server-2.1.0/build/script/package_opengauss.sh 2024-11-06 15:13:03.650408634 +0800
@@ -66,6 +66,9 @@
dist_version="KylinSec"
elif [ X"$kernel" = X"ubuntu" ]; then
dist_version="Ubuntu"
+# as the last judgement condition, the CUSTOM_VENDOR_PLACEHOLDER will be replace by vendor macro in spec file
+elif [ X"$kernel" = X"CUSTOM_VENDOR_PLACEHOLDER_LOWERCASE" ]; then
+ dist_version="CUSTOM_VENDOR_PLACEHOLDER"
else
echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64), KylinSec(aarch64) and Ubuntu(x86) platform."
echo "Kernel is $kernel"
@@ -124,7 +127,7 @@
##add platform architecture information
PLATFORM_ARCH=$(uname -p)
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
- if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] && [ "$dist_version" != "KylinSec" ] ; then
+ if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] && [ "$dist_version" != "KylinSec" ] && [ "$dist_version" != "CUSTOM_VENDOR_PLACEHOLDER" ]; then
echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64), KylinSec(aarch64) platform."
exit 1
fi
diff -Naur a/openGauss-server-2.1.0/src/get_PlatForm_str.sh b/openGauss-server-2.1.0/src/get_PlatForm_str.sh
--- a/openGauss-server-2.1.0/src/get_PlatForm_str.sh 2024-11-06 09:45:40.281917930 +0800
+++ b/openGauss-server-2.1.0/src/get_PlatForm_str.sh 2024-11-06 14:40:31.071558697 +0800
@@ -163,6 +163,12 @@
# other platform
#
##################################################################################
+# as the last judgement condition, the CUSTOM_VENDOR_PLACEHOLDER will be replace by vendor macro in spec file
+if [ -z "$plat_form_str" ] && [ "$kernel"x = "CUSTOM_VENDOR_PLACEHOLDER_LOWERCASE"x ]
+then
+ plat_form_str=CUSTOM_VENDOR_PLACEHOLDER_"$cpu_bit"
+fi
+
if [ -z "$plat_form_str" ]
then
echo "Failed"

1789
3000-add-sw_64-support.patch Normal file

File diff suppressed because it is too large Load Diff

40
compile_2309.patch Normal file
View File

@ -0,0 +1,40 @@
diff -crN '--exclude=.git' '--exclude=.gitee' openGauss-server-2.1.0/src/bin/pg_basebackup/pg_basebackup.cpp openGauss-server-2.1.0-edit/src/bin/pg_basebackup/pg_basebackup.cpp
*** openGauss-server-2.1.0/src/bin/pg_basebackup/pg_basebackup.cpp 2021-12-13 16:23:09.000000000 +0800
--- openGauss-server-2.1.0-edit/src/bin/pg_basebackup/pg_basebackup.cpp 2023-08-14 10:19:02.650301090 +0800
***************
*** 1584,1590 ****
struct dirent* ent;
while (1) {
ent = readdir(dir);
! if (ent <= 0) {
break;
}
if ((strcmp(".", ent->d_name) == 0) || (strcmp("..", ent->d_name) == 0)) {
--- 1584,1590 ----
struct dirent* ent;
while (1) {
ent = readdir(dir);
! if (ent == NULL) {
break;
}
if ((strcmp(".", ent->d_name) == 0) || (strcmp("..", ent->d_name) == 0)) {
diff -crN '--exclude=.git' '--exclude=.gitee' openGauss-server-2.1.0/src/gausskernel/runtime/opfusion/opfusion_util.cpp openGauss-server-2.1.0-edit/src/gausskernel/runtime/opfusion/opfusion_util.cpp
*** openGauss-server-2.1.0/src/gausskernel/runtime/opfusion/opfusion_util.cpp 2021-12-13 16:23:09.000000000 +0800
--- openGauss-server-2.1.0-edit/src/gausskernel/runtime/opfusion/opfusion_util.cpp 2023-08-14 10:18:07.476105895 +0800
***************
*** 405,411 ****
/* check whether to have order by */
if (node->aggstrategy != AGG_PLAIN ||
! node->groupingSets > 0) {
return NOBYPASS_NOT_PLAIN_AGG;
}
--- 405,411 ----
/* check whether to have order by */
if (node->aggstrategy != AGG_PLAIN ||
! node->groupingSets != NIL) {
return NOBYPASS_NOT_PLAIN_AGG;
}

View File

@ -1,5 +1,3 @@
[ -f /etc/profile ] && source /etc/profile
export GAUSSHOME=/usr/local/opengauss/ export GAUSSHOME=/usr/local/opengauss/
export LD_LIBRARY_PATH=/usr/local/opengauss/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=/usr/local/opengauss/lib:$LD_LIBRARY_PATH
export PATH=/usr/local/opengauss/bin:$PATH export PATH=/usr/local/opengauss/bin:$PATH

View File

@ -9,10 +9,11 @@
%define port 7654 %define port 7654
%define datapath /var/lib/opengauss %define datapath /var/lib/opengauss
%define apppath %{_prefix}/local/opengauss %define apppath %{_prefix}/local/opengauss
%define vendor_lowercase %{?_vendor:%(echo %{_vendor} | tr '[:upper:]' '[:lower:]')}%{!?_vendor:openeuler}
Name: opengauss Name: opengauss
Version: 2.1.0 Version: 2.1.0
Release: 4 Release: 12
Summary: openGauss is an open source relational database management system Summary: openGauss is an open source relational database management system
License: MulanPSL-2.0 and MIT and BSD and zlib and TCL and Apache-2.0 and BSL-1.0 License: MulanPSL-2.0 and MIT and BSD and zlib and TCL and Apache-2.0 and BSL-1.0
URL: https://gitee.com/opengauss/openGauss-server URL: https://gitee.com/opengauss/openGauss-server
@ -32,8 +33,12 @@ Patch21: 0002-zlib.patch
Patch22: 0003-zlib.patch Patch22: 0003-zlib.patch
Patch23: makefile-miniunz.patch Patch23: makefile-miniunz.patch
Patch40: 0001-orc.patch Patch40: 0001-orc.patch
Patch41: 0002-add-kylinsec-platform.patch
Patch42: 0004-add-custom-platform.patch
Patch50: openssl3-adptor.patch Patch50: openssl3-adptor.patch
Patch51: compile_2309.patch
Patch3000: 3000-add-sw_64-support.patch
BuildRequires: cmake gcc gcc-c++ openssl-devel python BuildRequires: cmake gcc gcc-c++ openssl-devel python
BuildRequires: cjson lz4-devel protobuf-devel snappy-devel zstd-devel boost-devel BuildRequires: cjson lz4-devel protobuf-devel snappy-devel zstd-devel boost-devel
BuildRequires: libcgroup-devel libcurl-devel unixODBC-devel jemalloc-devel krb5-devel BuildRequires: libcgroup-devel libcurl-devel unixODBC-devel jemalloc-devel krb5-devel
@ -42,6 +47,9 @@ BuildRequires: bison flex DCF
%ifnarch aarch64 %{arm} %ifnarch aarch64 %{arm}
BuildRequires: numactl-devel BuildRequires: numactl-devel
%endif %endif
%ifarch sw_64
BuildRequires: libatomic
%endif
%global _privatelibs lib(cjson|ecpg|z|pg|pq)\\.so* %global _privatelibs lib(cjson|ecpg|z|pg|pq)\\.so*
%global __provides_exclude %{_privatelibs} %global __provides_exclude %{_privatelibs}
@ -50,7 +58,7 @@ BuildRequires: numactl-devel
Requires: lz4-devel protobuf-devel snappy-devel zstd-devel boost-devel Requires: lz4-devel protobuf-devel snappy-devel zstd-devel boost-devel
Requires: libcgroup-devel libcurl-devel unixODBC-devel jemalloc-devel Requires: libcgroup-devel libcurl-devel unixODBC-devel jemalloc-devel
Requires: java-1.8.0-openjdk-devel libedit-devel libaio-devel Requires: java-1.8.0-openjdk-devel libedit-devel libaio-devel
Requires: DCF Requires: DCF lsof
%ifnarch aarch64 %{arm} %ifnarch aarch64 %{arm}
Requires: numactl-devel Requires: numactl-devel
%endif %endif
@ -70,6 +78,7 @@ openGauss kernel : openGauss is an open source relational database management sy
pushd openGauss-server-%{version} pushd openGauss-server-%{version}
%patch0 -p1 %patch0 -p1
%patch50 -p1 %patch50 -p1
%patch51 -p1
popd popd
pushd %{cjson_name}-%{cjson_version} pushd %{cjson_name}-%{cjson_version}
@ -87,6 +96,17 @@ pushd %{orc_name}-%{orc_version}
%patch40 -p1 %patch40 -p1
popd popd
%patch41 -p1
# custom vendor
%if "%{_vendor}" != "openEuler"
sed -i 's/CUSTOM_VENDOR_PLACEHOLDER_LOWERCASE/%{vendor_lowercase}/g' %{PATCH42}
sed -i 's/CUSTOM_VENDOR_PLACEHOLDER/%{_vendor}/g' %{PATCH42}
%endif
%patch42 -p1
%ifarch sw_64
%patch3000 -p1
%endif
%build %build
########### build cjson ########### ########### build cjson ###########
build_target=$(pwd)/deps_binarylibs build_target=$(pwd)/deps_binarylibs
@ -102,12 +122,18 @@ CONFIGURE_EXTRA_FLAG="--64"
%ifarch aarch64 %ifarch aarch64
CONFIGURE_EXTRA_FLAG="" CONFIGURE_EXTRA_FLAG=""
%endif %endif
%ifarch sw_64
CONFIGURE_EXTRA_FLAG=""
%endif
./configure ${CONFIGURE_EXTRA_FLAG} --prefix=${build_target}/zlib ./configure ${CONFIGURE_EXTRA_FLAG} --prefix=${build_target}/zlib
sed -i '21a CFLAGS += -fPIC' Makefile sed -i '21a CFLAGS += -fPIC' Makefile
MAKE_EXTRA_FLAG="-m64" MAKE_EXTRA_FLAG="-m64"
%ifarch aarch64 %ifarch aarch64
MAKE_EXTRA_FLAG="" MAKE_EXTRA_FLAG=""
%endif %endif
%ifarch sw_64
MAKE_EXTRA_FLAG=""
%endif
make CFLAGS="-fPIE -fPIC" SFLAGS="-O2 -fPIC -fstack-protector-strong -Wl,-z,noexecstack -Wl,-z,relro,-z,now ${MAKE_EXTRA_FLAG} -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN" %{?_smp_mflags} make CFLAGS="-fPIE -fPIC" SFLAGS="-O2 -fPIC -fstack-protector-strong -Wl,-z,noexecstack -Wl,-z,relro,-z,now ${MAKE_EXTRA_FLAG} -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN" %{?_smp_mflags}
make install make install
cd contrib/minizip/ cd contrib/minizip/
@ -153,9 +179,15 @@ popd
########### build opengauss ########### ########### build opengauss ###########
pushd openGauss-server-%{version} pushd openGauss-server-%{version}
echo "PRODUCT=openGauss" > build/script/gauss.spec
echo "VERSION=2.1.0" >> build/script/gauss.spec
chmod +x ./configure chmod +x ./configure
./configure \ ./configure \
%ifarch sw_64
CC=g++ CFLAGS='-O0' \
%else
CC=g++ CFLAGS='-O2' \ CC=g++ CFLAGS='-O2' \
%endif
--prefix=%{apppath} \ --prefix=%{apppath} \
--3rd=${build_target} \ --3rd=${build_target} \
--enable-thread-safety \ --enable-thread-safety \
@ -186,15 +218,28 @@ install -m 644 %{SOURCE6} %{buildroot}/%{apppath}/script/opengauss.service
install -m 700 %{SOURCE7} %{buildroot}/%{apppath}/script/autostart.sh install -m 700 %{SOURCE7} %{buildroot}/%{apppath}/script/autostart.sh
%pre %pre
/usr/sbin/groupadd -g 39 -o -r opengauss >/dev/null 2>&1 || : /usr/sbin/groupadd opengauss >/dev/null 2>&1 || :
/usr/sbin/useradd -M -N -g opengauss -o -r -d %{datapath} -s /bin/bash \ /usr/sbin/useradd -M -N -g opengauss -d %{datapath} -s /bin/bash \
-c "openGauss Server" -u 39 opengauss >/dev/null 2>&1 || : -c "openGauss Server" opengauss >/dev/null 2>&1 || :
# for install step
if [ $1 = 1 ]; then
portinfo=$(lsof -i:%{port})
if [ "${portinfo}" != "" ]; then
echo "The port[%{port}] is occupied. Please use command 'lsof -i:%{port} to check it.'"
exit 1
fi
fi
%post %post
# set opengauss mini config parameters # set opengauss mini config parameters
set_mini_configparam(){ set_mini_configparam(){
config_mini_file=%{apppath}/share/postgresql/opengauss_config_file_mini config_mini_file=%{apppath}/share/postgresql/opengauss_config_file_mini
# set guc parameters
echo "port = %{port}" >> ${config_mini_file} echo "port = %{port}" >> ${config_mini_file}
echo "synchronous_commit = off" >> ${config_mini_file}
echo "listen_addresses = '127.0.0.1'" >> ${config_mini_file}
config_sample_file=%{apppath}/share/postgresql/postgresql.conf.sample config_sample_file=%{apppath}/share/postgresql/postgresql.conf.sample
if [[ -f $config_mini_file ]] if [[ -f $config_mini_file ]]
@ -229,13 +274,13 @@ start_opengauss(){
return 0 return 0
fi fi
result=`su - opengauss -c "source ~/.bash_profile; gs_initdb -D /var/lib/opengauss/data -U opengauss --nodename=single_node"` result=`su - opengauss -c "source /var/lib/opengauss/.bash_profile; gs_initdb -D /var/lib/opengauss/data -U opengauss --nodename=single_node"`
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Init openGauss database failed." echo "Init openGauss database failed."
echo $result echo $result
else else
echo "Init openGauss database success." echo "Init openGauss database success."
result=`su - opengauss -c "source ~/.bash_profile; gs_ctl start -D /var/lib/opengauss/data"` result=`su - opengauss -c "source /var/lib/opengauss/.bash_profile; gs_ctl start -D /var/lib/opengauss/data"`
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Start openGauss database failed." echo "Start openGauss database failed."
echo $result echo $result
@ -266,7 +311,7 @@ remove_service(){
fi fi
} }
clear_database(){ clear_database(){
pid=$(ps -ef | grep /var/lib/opengauss/data | grep -v grep | awk '{print $2}') pid=$(ps -ef | grep /usr/local/opengauss/bin/gaussdb | grep -v grep | awk '{print $2}')
if [ "$pid" != "" ]; then if [ "$pid" != "" ]; then
kill -9 $pid kill -9 $pid
fi fi
@ -290,9 +335,33 @@ fi
%changelog %changelog
* Sat Feb 11 2023 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-4 * Mon Nov 11 2024 xiaochn <xiaochuannan@inspur.com> - 2.1.0-12
- fix build error when custom vendor
* Fri Aug 18 2023 panchenbo <panchenbo@kylinsec.com.cn> - 2.1.0-11
- add sw_64 support
* Mon Aug 14 2023 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-10
- Fix bugs: #I7QJRO
* Tue Jun 6 2023 dillon chen<dillon.chen@gmail.com> - 2.1.0-9
- Fix bugs: #I677QX add lsof
* Mon Apr 10 2023 panchenbo <panchenbo@kylinsec.com.cn> - 2.1.0-8
- add /etc/kylinsec-release support for KylinSec
* Sat Feb 11 2023 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-7
- Fix bugs: #I6ED94 - Fix bugs: #I6ED94
* Wed Mar 30 2022 ouyangminxiang <ouyangminxiang@kylinsec.com.cn> - 2.1.0-6
- add kylinsec platform
* Sat Mar 12 2022 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-5
- Fix bugs: #I4VDYQ #I4V624 #I4UOUU #I4TCDB #I4TCB8
* Thu Jan 27 2022 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-4
- Fix bugs: #I4SDWX
* Sat Jan 22 2022 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-3 * Sat Jan 22 2022 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-3
- Fix bugs: #I4RVNX - Fix bugs: #I4RVNX