Skip to content

Commit 9cf70d8

Browse files
facetoseasangshuduofacetosea
authored
Fix/xsren/mac enterprise base 3.0.2.1 (#19064)
* fix: release script support macos (#19047) * fix/mac_m1_enterprise Co-authored-by: Shuduo Sang <[email protected]> Co-authored-by: facetosea <[email protected]>
1 parent bdd1dc6 commit 9cf70d8

File tree

4 files changed

+51
-17
lines changed

4 files changed

+51
-17
lines changed

cmake/cmake.define

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ ELSE ()
124124
ENDIF ()
125125

126126
INCLUDE(CheckCCompilerFlag)
127-
IF (("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_C_COMPILER_ID}" MATCHES "AppleClang"))
127+
IF (TD_ARM_64 OR TD_ARM_32)
128+
SET(COMPILER_SUPPORT_SSE42 false)
129+
ELSEIF (("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_C_COMPILER_ID}" MATCHES "AppleClang"))
128130
SET(COMPILER_SUPPORT_SSE42 true)
129131
MESSAGE(STATUS "Always enable sse4.2 for Clang/AppleClang")
130132
ELSE()

packaging/release.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Generate the deb package for ubuntu, or rpm package for centos, or tar.gz package for other linux os
44

55
set -e
6-
#set -x
6+
# set -x
77

88
# release.sh -v [cluster | edge]
99
# -c [aarch32 | aarch64 | x64 | x86 | mips64 | loongarch64...]
@@ -96,6 +96,8 @@ while getopts "hv:V:c:o:l:s:d:a:n:m:H:" arg; do
9696
esac
9797
done
9898

99+
osType=$(uname)
100+
99101
echo "verMode=${verMode} verType=${verType} cpuType=${cpuType} osType=${osType} pagMode=${pagMode} soMode=${soMode} dbName=${dbName} allocator=${allocator} verNumber=${verNumber} verNumberComp=${verNumberComp} httpdBuild=${httpdBuild}"
100102

101103
curr_dir=$(pwd)
@@ -233,7 +235,12 @@ else
233235
exit 1
234236
fi
235237

236-
CORES=$(grep -c ^processor /proc/cpuinfo)
238+
ostype=`uname`
239+
if [ "${ostype}" == "Darwin" ]; then
240+
CORES=$(sysctl -n hw.ncpu)
241+
else
242+
CORES=$(grep -c ^processor /proc/cpuinfo)
243+
fi
237244

238245
if [[ "$allocator" == "jemalloc" ]]; then
239246
# jemalloc need compile first, so disable parallel build
@@ -306,7 +313,7 @@ if [ "$osType" != "Darwin" ]; then
306313
${csudo}./makeclient.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${dbName}
307314

308315
else
309-
# only make client for Darwin
310316
cd ${script_dir}/tools
317+
./makepkg.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${verNumberComp} ${dbName}
311318
./makeclient.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${dbName}
312319
fi

packaging/tools/makeclient.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Generate tar.gz package for linux client in all os system
44
set -e
5-
#set -x
5+
# set -x
66

77
curr_dir=$(pwd)
88
compile_dir=$1
@@ -249,9 +249,9 @@ if [ "$osType" != "Darwin" ]; then
249249
tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) --remove-files || :
250250
else
251251
tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) || :
252-
mv "$(basename ${pkg_name}).tar.gz" ..
253-
rm -rf ./*
254-
mv ../"$(basename ${pkg_name}).tar.gz" .
252+
# mv "$(basename ${pkg_name}).tar.gz" ..
253+
rm -rf ${install_dir} ||:
254+
# mv ../"$(basename ${pkg_name}).tar.gz" .
255255
fi
256256

257257
cd ${curr_dir}

packaging/tools/makepkg.sh

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Generate tar.gz package for all os system
44

55
set -e
6-
#set -x
6+
# set -x
77

88
curr_dir=$(pwd)
99
compile_dir=$1
@@ -74,14 +74,16 @@ else
7474
tdinsight_caches=""
7575
cd ${build_dir}/bin/ && \
7676
chmod +x TDinsight.sh
77-
tdinsight_caches=$(./TDinsight.sh --download-only | xargs -i printf "${build_dir}/bin/{} ")
77+
./TDinsight.sh --download-only ||:
78+
# tdinsight_caches=$(./TDinsight.sh --download-only | xargs -I printf "${build_dir}/bin/{} ")
7879
cd $orig_pwd
7980
echo "TDinsight caches: $tdinsight_caches"
8081

8182
taostools_bin_files=" ${build_dir}/bin/taosdump \
8283
${build_dir}/bin/taosBenchmark \
8384
${build_dir}/bin/TDinsight.sh \
84-
$tdinsight_caches"
85+
${build_dir}/bin/tdengine-datasource.zip \
86+
${build_dir}/bin/tdengine-datasource.zip.md5sum"
8587
[ -f ${build_dir}/bin/taosx ] && taosx_bin="${build_dir}/bin/taosx"
8688

8789
bin_files="${build_dir}/bin/${serverName} \
@@ -96,8 +98,13 @@ else
9698
${script_dir}/taosd-dump-cfg.gdb"
9799
fi
98100

99-
lib_files="${build_dir}/lib/libtaos.so.${version}"
100-
wslib_files="${build_dir}/lib/libtaosws.so"
101+
if [ "$osType" == "Darwin" ]; then
102+
lib_files="${build_dir}/lib/libtaos.${version}.dylib"
103+
wslib_files="${build_dir}/lib/libtaosws.dylib"
104+
else
105+
lib_files="${build_dir}/lib/libtaos.so.${version}"
106+
wslib_files="${build_dir}/lib/libtaosws.so"
107+
fi
101108
header_files="${code_dir}/include/client/taos.h ${code_dir}/include/common/taosdef.h ${code_dir}/include/util/taoserror.h ${code_dir}/include/libs/function/taosudf.h"
102109

103110
wsheader_files="${build_dir}/include/taosws.h"
@@ -226,7 +233,12 @@ if [ "$verMode" == "cloud" ]; then
226233
fi
227234

228235
cd ${install_dir}
229-
tar -zcv -f ${tarName} * --remove-files || :
236+
if [ "$osType" != "Darwin" ]; then
237+
tar -zcv -f ${tarName} * --remove-files || :
238+
else
239+
tar -zcv -f ${tarName} * || :
240+
fi
241+
230242
exitcode=$?
231243
if [ "$exitcode" != "0" ]; then
232244
echo "tar ${tarName} error !!!"
@@ -288,7 +300,7 @@ if [[ $dbName == "taos" ]]; then
288300
if [ "$verMode" == "cluster" ] || [ "$verMode" == "cloud" ]; then
289301
if [ -d "${web_dir}/admin" ] ; then
290302
mkdir -p ${install_dir}/share/
291-
cp ${web_dir}/admin ${install_dir}/share/ -r
303+
cp -Rfap ${web_dir}/admin ${install_dir}/share/
292304
cp ${web_dir}/png/taos.png ${install_dir}/share/admin/images/taos.png
293305
else
294306
echo "directory not found for enterprise release: ${web_dir}/admin"
@@ -362,7 +374,15 @@ if [ "$pagMode" == "lite" ]; then
362374
pkg_name=${pkg_name}-Lite
363375
fi
364376

365-
tar -zcv -f "$(basename ${pkg_name}).tar.gz" "$(basename ${install_dir})" --remove-files || :
377+
378+
if [ "$osType" != "Darwin" ]; then
379+
tar -zcv -f "$(basename ${pkg_name}).tar.gz" "$(basename ${install_dir})" --remove-files || :
380+
else
381+
tar -zcv -f "$(basename ${pkg_name}).tar.gz" "$(basename ${install_dir})" || :
382+
rm -rf ${install_dir} ||:
383+
([ -d build-taoskeeper ] && rm -rf build-taoskeeper ) ||:
384+
fi
385+
366386
exitcode=$?
367387
if [ "$exitcode" != "0" ]; then
368388
echo "tar ${pkg_name}.tar.gz error !!!"
@@ -371,7 +391,12 @@ fi
371391

372392
if [ -n "${taostools_bin_files}" ]; then
373393
wget https://github.com/taosdata/grafanaplugin/releases/latest/download/TDinsight.sh -O ${taostools_install_dir}/bin/TDinsight.sh && echo "TDinsight.sh downloaded!"|| echo "failed to download TDinsight.sh"
374-
tar -zcv -f "$(basename ${taostools_pkg_name}).tar.gz" "$(basename ${taostools_install_dir})" --remove-files || :
394+
if [ "$osType" != "Darwin" ]; then
395+
tar -zcv -f "$(basename ${taostools_pkg_name}).tar.gz" "$(basename ${taostools_install_dir})" --remove-files || :
396+
else
397+
tar -zcv -f "$(basename ${taostools_pkg_name}).tar.gz" "$(basename ${taostools_install_dir})" || :
398+
rm -rf ${taostools_install_dir} ||:
399+
fi
375400
exitcode=$?
376401
if [ "$exitcode" != "0" ]; then
377402
echo "tar ${taostools_pkg_name}.tar.gz error !!!"

0 commit comments

Comments
 (0)