Skip to content

Commit

Permalink
fix(scripts): skip packaging irrelevant libs (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Tao authored and neverchanje committed Mar 31, 2021
1 parent ec9a9e6 commit b16994b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: pull_request
on:
# run on each pull request
pull_request:
types: [ synchronize, reopened, labeled ]
types: [ synchronize, opened ]
branches:
- master
- 'v[0-9]+.*' # release branch
Expand Down Expand Up @@ -55,6 +55,12 @@ jobs:
run: unzip /root/thirdparties-bin.zip -d ./rdsn/thirdparty
- name: Compilation
run: ./run.sh build -c --skip_thirdparty
-
name: Packaging Server
run: ./run.sh pack_server
-
name: Packaging Tools
run: ./run.sh pack_tools
- name: Unit Testing
run: |
source ./config_hdfs.sh
Expand Down
14 changes: 12 additions & 2 deletions scripts/pack_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,22 @@ function check_bit()
fi
}

function pack_system_lib()
{
function need_system_lib() {
# return if system libname is not empty, if false, it means this library is not a dependency
libname=$(ldd ./DSN_ROOT/bin/pegasus_"$1"/pegasus_"$1" 2>/dev/null | grep "lib${2}\.so")
[ -n "${libname}" ]
}

function pack_system_lib() {
local package_path=$1
local package_type=$2
local lib_name=$3

if ! need_system_lib "${package_type}" "${lib_name}"; then
echo "ERROR: ${lib_name} is not a required dependency, skip packaging this lib"
return;
fi

SYS_LIB_PATH=$(get_system_lib "${package_type}" "${lib_name}")
if [ -z "${SYS_LIB_PATH}" ]; then
echo "ERROR: library ${lib_name} is missing on your system"
Expand Down

0 comments on commit b16994b

Please sign in to comment.