From 09fac4d2445d6744bd491febcb388a1357630ecc Mon Sep 17 00:00:00 2001 From: cpw <13495049+CPWstatic@users.noreply.github.com> Date: Thu, 19 Aug 2021 17:06:32 +0800 Subject: [PATCH] Revert package modify (#1323) * Revert package.sh modify. * Update pr workflow to clang10. * rm linker. --- .github/workflows/pull_request.yml | 8 +++----- package/package.sh | 25 ++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 916184856..effcb0d4a 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -44,14 +44,14 @@ jobs: - ubuntu2004 compiler: - gcc-9.2 - - clang-9 + - clang-10 exclude: - os: centos7 - compiler: clang-9 + compiler: clang-10 container: image: vesoft/nebula-dev:${{ matrix.os }} env: - TOOLSET_DIR: /opt/vesoft/toolset/clang/9.0.0 + TOOLSET_DIR: /opt/vesoft/toolset/clang/10.0.0 CCACHE_DIR: /tmp/ccache/nebula-graph/${{ matrix.os }}-${{ matrix.compiler }} CCACHE_MAXSIZE: 8G volumes: @@ -104,7 +104,6 @@ jobs: -DCMAKE_BUILD_TYPE=Debug \ -DENABLE_TESTING=on \ -DENABLE_BUILD_STORAGE=on \ - -DNEBULA_USE_LINKER=lld \ -B build echo "::set-output name=j::10" ;; @@ -119,7 +118,6 @@ jobs: -DENABLE_ASAN=on \ -DENABLE_TESTING=on \ -DENABLE_BUILD_STORAGE=on \ - -DNEBULA_USE_LINKER=lld \ -B build echo "::set-output name=j::6" ;; diff --git a/package/package.sh b/package/package.sh index e98395e70..c3eed9028 100755 --- a/package/package.sh +++ b/package/package.sh @@ -173,7 +173,25 @@ function package { args="" [[ $strip_enable == TRUE ]] && args="-D CPACK_STRIP_FILES=TRUE -D CPACK_RPM_SPEC_MORE_DEFINE=" - if ! ( cpack --verbose $args ); then + sys_ver="" + pType="RPM" + if [[ -f "/etc/redhat-release" ]]; then + sys_name=$(< /etc/redhat-release cut -d ' ' -f1) + if [[ ${sys_name} == "CentOS" ]]; then + sys_ver=$(< /etc/redhat-release tr -dc '0-9.' | cut -d \. -f1) + sys_ver=.el${sys_ver}.x86_64 + elif [[ ${sys_name} == "Fedora" ]]; then + sys_ver=$(< /etc/redhat-release cut -d ' ' -f3) + sys_ver=.fc${sys_ver}.x86_64 + fi + pType="RPM" + elif [[ -f "/etc/lsb-release" ]]; then + sys_ver=$(< /etc/lsb-release grep DISTRIB_RELEASE | cut -d "=" -f 2 | sed 's/\.//') + sys_ver=.ubuntu${sys_ver}.amd64 + pType="DEB" + fi + + if ! ( cpack -G ${pType} --verbose $args ); then echo ">>> package nebula failed <<<" exit 1 else @@ -181,8 +199,9 @@ function package { outputDir=$build_dir/cpack_output mkdir -p ${outputDir} for pkg_name in $(ls ./*nebula*-${version}*); do - mv ${pkg_name} ${outputDir}/ - echo "####### taget package file is ${outputDir}/${pkg_name}" + new_pkg_name=${pkg_name/\-Linux/${sys_ver}} + mv ${pkg_name} ${outputDir}/${new_pkg_name} + echo "####### taget package file is ${outputDir}/${new_pkg_name}" done fi