BiteTheDDDDt commented on code in PR #12691: URL: https://github.com/apache/doris/pull/12691#discussion_r973586836
########## thirdparty/build-thirdparty.sh: ########## @@ -1408,6 +1416,77 @@ build_xxhash() { cp libxxhash.a "${TP_INSTALL_DIR}/lib64" } +####################################[ Build ]################################### + +# Choose what to compile +if [[ -d ${TP_INSTALL_DIR} && "${DEPS}" != "" ]]; then + for i in `echo ${DEPS}`; do + build_${i} + done + echo "Built specified dependencies: ${DEPS}" + exit +fi + +if [[ -f version.txt ]]; then + CUR_VERSION=`cat version.txt | grep -v "#"` +else + CUR_VERSION="y" +fi + +if [[ -f ${TP_INSTALL_DIR}/version.txt ]]; then + INSTALLED_VERSION=`cat ${TP_INSTALL_DIR}/version.txt | grep -v "#"` +else + INSTALLED_VERSION="x" +fi + +if [[ "${CUR_VERSION}" == "${INSTALLED_VERSION}" && ${BUILD_ALL} -eq 0 ]]; then + echo "Installed dependencies are up to date, if you want to rebuild all dependencies, use -a option" + exit +fi + +# Incremental build +if [[ -f version.txt && -f ${TP_INSTALL_DIR}/version.txt && ${BUILD_ALL} -eq 0 ]]; then + CUR_VERSION=`cat version.txt | grep -v "#" | awk '{print $1; exit}'` + INSTALLED_VERSION=`cat ${TP_INSTALL_DIR}/version.txt | grep -v "#" | awk '{print $1; exit}'` + if [[ "${INSTALLED_VERSION}" -gt "${CUR_VERSION}" ]]; then + echo "Installed dependencies are up to date, if you want to downgrade, use -a or -d option to rebuild" + exit + fi + VER_DIFF=$[${CUR_VERSION} - ${INSTALLED_VERSION}] + if [[ ${VER_DIFF} -lt 2 ]]; then + INC_BUILD_DEPS="" + CNT=0 + for i in `cat version.txt | grep -v "#"`; do + if [[ ${CNT} -lt 2 ]]; then + CNT=$[${CNT} + 1] + continue + fi + INC_BUILD_DEPS="${INC_BUILD_DEPS} ${i}" Review Comment: Maybe we can find the thirdparty that needs incremental build by checking the md5 of the downloaded package? which can avoid manually updating version.txt every time -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org