Skip to content

Commit

Permalink
try copy libnsl.so to INSTALL_DIR (#3203) (#3206)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Jan 24, 2022
1 parent 2e07845 commit 75b7b60
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
3 changes: 3 additions & 0 deletions release-centos7/build/build-tiflash-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ cp -r "${SRCPATH}/cluster_manage/dist/flash_cluster_manager" "${INSTALL_DIR}"/fl
cp -f "$build_dir/dbms/src/Server/tiflash" "${INSTALL_DIR}/tiflash"
cp -f "${SRCPATH}/libs/libtiflash-proxy/libtiflash_proxy.so" "${INSTALL_DIR}/libtiflash_proxy.so"
ldd "${INSTALL_DIR}/tiflash"

ldd "${INSTALL_DIR}/tiflash" | grep 'libnsl.so' | grep '=>' | awk '{print $3}' | xargs -I {} cp {} "${INSTALL_DIR}"

cd "${INSTALL_DIR}"
chrpath -d libtiflash_proxy.so "${INSTALL_DIR}/tiflash"
ldd "${INSTALL_DIR}/tiflash"
Expand Down
28 changes: 16 additions & 12 deletions release-centos7/build/build-tiflash-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SRCPATH=$(cd ${SCRIPTPATH}/../..; pwd -P)
NPROC=${NPROC:-$(nproc || grep -c ^processor /proc/cpuinfo)}
ENABLE_EMBEDDED_COMPILER="FALSE"

install_dir="$SRCPATH/release-centos7/tiflash"
INSTALL_DIR="${SRCPATH}/release-centos7/tiflash"

if [ -d "$SRCPATH/contrib/kvproto" ]; then
cd "$SRCPATH/contrib/kvproto"
Expand All @@ -40,10 +40,10 @@ rm -rf ${SRCPATH}/libs/libtiflash-proxy
mkdir -p ${SRCPATH}/libs/libtiflash-proxy
ln -s ${SRCPATH}/contrib/tiflash-proxy/target/release/libtiflash_proxy.so ${SRCPATH}/libs/libtiflash-proxy/libtiflash_proxy.so

build_dir="$SRCPATH/release-centos7/build-release"
rm -rf $build_dir && mkdir -p $build_dir && cd $build_dir
BUILD_DIR="${SRCPATH}/release-centos7/build-release"
rm -rf ${BUILD_DIR} && mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}

cmake "$SRCPATH" ${DEFINE_CMAKE_PREFIX_PATH} \
cmake "${SRCPATH}" ${DEFINE_CMAKE_PREFIX_PATH} \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DENABLE_EMBEDDED_COMPILER=${ENABLE_EMBEDDED_COMPILER} \
-DENABLE_ICU=OFF \
Expand All @@ -53,15 +53,19 @@ cmake "$SRCPATH" ${DEFINE_CMAKE_PREFIX_PATH} \
-Wno-dev \
-DUSE_CCACHE=OFF

make -j $NPROC tiflash
make -j ${NPROC} tiflash

# Reduce binary size by compressing.
objcopy --compress-debug-sections=zlib-gnu "$build_dir/dbms/src/Server/tiflash"
objcopy --compress-debug-sections=zlib-gnu "${BUILD_DIR}/dbms/src/Server/tiflash"

cp -f "$build_dir/dbms/src/Server/tiflash" "$install_dir/tiflash"
cp -f "${SRCPATH}/libs/libtiflash-proxy/libtiflash_proxy.so" "$install_dir/libtiflash_proxy.so"
cp -f "${BUILD_DIR}/dbms/src/Server/tiflash" "${INSTALL_DIR}/tiflash"
cp -f "${SRCPATH}/libs/libtiflash-proxy/libtiflash_proxy.so" "${INSTALL_DIR}/libtiflash_proxy.so"

ldd "$install_dir/tiflash"
cd "$install_dir"
chrpath -d libtiflash_proxy.so "$install_dir/tiflash"
ldd "$install_dir/tiflash"
ldd "${INSTALL_DIR}/tiflash"

ldd "${INSTALL_DIR}/tiflash" | grep 'libnsl.so' | grep '=>' | awk '{print $3}' | xargs -I {} cp {} "${INSTALL_DIR}"

cd "${INSTALL_DIR}"
chrpath -d libtiflash_proxy.so "${INSTALL_DIR}/tiflash"
ldd "${INSTALL_DIR}/tiflash"
ls -lh "${INSTALL_DIR}"

0 comments on commit 75b7b60

Please sign in to comment.