diff --git a/release-centos7/build/build-tiflash-ci.sh b/release-centos7/build/build-tiflash-ci.sh index 105fc3e65d0..ba284dcf94b 100755 --- a/release-centos7/build/build-tiflash-ci.sh +++ b/release-centos7/build/build-tiflash-ci.sh @@ -139,6 +139,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" diff --git a/release-centos7/build/build-tiflash-release.sh b/release-centos7/build/build-tiflash-release.sh index 8ae1794e263..fd5bbff7b7e 100755 --- a/release-centos7/build/build-tiflash-release.sh +++ b/release-centos7/build/build-tiflash-release.sh @@ -20,16 +20,16 @@ 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" 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 \ @@ -39,15 +39,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}"