From 4e7525b349f86a81264ac9c2e523fe0e8ae8ad07 Mon Sep 17 00:00:00 2001 From: Dan Wang Date: Sun, 4 Feb 2024 14:56:20 +0800 Subject: [PATCH] fix(shell): add missing librocksdb.so.8 while packing tools and fix errors while launching shell (#1887) * fix(shell): add missing librocksdb.so.8 while packing tools and fix errors while launching shell * fix run_shell --- run.sh | 15 ++++++++++++--- scripts/pack_tools.sh | 3 ++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/run.sh b/run.sh index 54a8502f75..96d4d64187 100755 --- a/run.sh +++ b/run.sh @@ -20,12 +20,12 @@ set -e LOCAL_HOSTNAME=`hostname -f` PID=$$ -ROOT=`pwd` +ROOT="$(cd "$(dirname "$0")" && pwd)" export BUILD_ROOT_DIR=${ROOT}/build export BUILD_LATEST_DIR=${BUILD_ROOT_DIR}/latest export REPORT_DIR="$ROOT/test_report" export THIRDPARTY_ROOT=$ROOT/thirdparty -export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server:${BUILD_LATEST_DIR}/output/lib:${THIRDPARTY_ROOT}/output/lib:${LD_LIBRARY_PATH} +export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server:${ROOT}/lib:${BUILD_LATEST_DIR}/output/lib:${THIRDPARTY_ROOT}/output/lib:${LD_LIBRARY_PATH} # Disable AddressSanitizerOneDefinitionRuleViolation, see https://github.com/google/sanitizers/issues/1017 for details. export ASAN_OPTIONS=detect_odr_violation=0 # See https://github.com/gperftools/gperftools/wiki/gperftools'-stacktrace-capturing-methods-and-their-issues. @@ -1720,7 +1720,16 @@ function run_shell() fi cd ${ROOT} - ln -s -f ${BUILD_LATEST_DIR}/output/bin/pegasus_shell/pegasus_shell + if [ -f ${ROOT}/bin/pegasus_shell/pegasus_shell ]; then + # The pegasus_shell was packaged by pack_tools, to be used on production environment. + ln -s -f ${ROOT}/bin/pegasus_shell/pegasus_shell + elif [ -f ${BUILD_LATEST_DIR}/output/bin/pegasus_shell/pegasus_shell ]; then + # The pegasus_shell was built locally, to be used for test on development environment. + ln -s -f ${BUILD_LATEST_DIR}/output/bin/pegasus_shell/pegasus_shell + else + echo "ERROR: pegasus_shell could not be found" + exit 1 + fi ./pegasus_shell ${CONFIG} $CLUSTER_NAME # because pegasus shell will catch 'Ctrl-C' signal, so the following commands will be executed # even user inputs 'Ctrl-C', so that the temporary config file will be cleared when exit shell. diff --git a/scripts/pack_tools.sh b/scripts/pack_tools.sh index efc9ea59d3..ae7706867c 100755 --- a/scripts/pack_tools.sh +++ b/scripts/pack_tools.sh @@ -132,7 +132,8 @@ else fi copy_file ./thirdparty/output/lib/libboost*.so.1.69.0 ${pack}/lib/ -copy_file ./thirdparty/output/lib/libhdfs* ${pack}/lib +copy_file ./thirdparty/output/lib/libhdfs* ${pack}/lib/ +copy_file ./thirdparty/output/lib/librocksdb.so.8 ${pack}/lib/ copy_file `get_stdcpp_lib $custom_gcc` ${pack}/lib/ pack_tools_lib() {