diff --git a/.ci/integration_test.groovy b/.ci/integration_test.groovy index 0ee42dd022d..db8442e7ef8 100644 --- a/.ci/integration_test.groovy +++ b/.ci/integration_test.groovy @@ -33,6 +33,9 @@ catchError { timeout(time: 60, unit: 'MINUTES') { container("golang") { sh """ + rm -rf ${curws}/tics/contrib + rm -rf ${curws}/tics/.git + COMMIT_HASH=${params.ghprbActualCommit} PULL_ID=${params.ghprbPullId} TAR_PATH=${curws}/tics/tests/.build bash -e ${curws}/tics/release-centos7/build/fetch-ci-build.sh """ } diff --git a/release-centos7/build/build-tiflash-ci.sh b/release-centos7/build/build-tiflash-ci.sh index d0f3bba617f..f83683782b9 100755 --- a/release-centos7/build/build-tiflash-ci.sh +++ b/release-centos7/build/build-tiflash-ci.sh @@ -1,5 +1,9 @@ #!/bin/bash +set -x + +ARCH=$(uname -p) + command -v ccache >/dev/null 2>&1 if [[ $? != 0 ]]; then echo "try to install ccache" @@ -18,7 +22,18 @@ else fi clang-format --version -set -ueox pipefail +command -v cmake-3.22 >/dev/null 2>&1 +if [[ $? != 0 ]]; then + curl -o /root/cmake-3.22.tar.gz http://fileserver.pingcap.net/download/builds/pingcap/tiflash/ci-cache/cmake-3.22.3-linux-${ARCH}.tar.gz + cd /root + tar zxf cmake-3.22.tar.gz + rm -rf /usr/bin/cmake-3.22 + ln -s /root/cmake-3.22.3-linux-${ARCH}/bin/cmake /usr/bin/cmake-3.22 + rm cmake-3.22.tar.gz +fi +cmake-3.22 --version + +set -ueo pipefail SCRIPTPATH="$( cd "$(dirname "$0")" @@ -34,6 +49,7 @@ BUILD_BRANCH=${BUILD_BRANCH:-master} ENABLE_FORMAT_CHECK=${ENABLE_FORMAT_CHECK:-false} if [[ "${ENABLE_FORMAT_CHECK}" == "true" ]]; then + cd ${SRCPATH} python3 ${SRCPATH}/format-diff.py --repo_path "${SRCPATH}" --check_formatted --diff_from $(git merge-base origin/${BUILD_BRANCH} HEAD) --dump_diff_files_to "/tmp/tiflash-diff-files.json" export ENABLE_FORMAT_CHECK=false fi @@ -125,11 +141,12 @@ chmod 0731 "${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} -cmake "$SRCPATH" \ +cmake-3.22 -S "$SRCPATH" \ -DENABLE_EMBEDDED_COMPILER=$ENABLE_EMBEDDED_COMPILER \ -DENABLE_TESTS=${ENABLE_TESTS} \ -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \ -DUSE_CCACHE=${USE_CCACHE} \ + -DUSE_INTERNAL_ZLIB_LIBRARY=OFF \ -DDEBUG_WITHOUT_DEBUG_INFO=ON make -j ${NPROC} tiflash diff --git a/release-centos7/build/build-tiflash-release.sh b/release-centos7/build/build-tiflash-release.sh index 281e22ec5f0..85e35018755 100755 --- a/release-centos7/build/build-tiflash-release.sh +++ b/release-centos7/build/build-tiflash-release.sh @@ -1,5 +1,20 @@ #!/bin/bash +set -x + +ARCH=$(uname -p) + +command -v cmake-3.22 >/dev/null 2>&1 +if [[ $? != 0 ]]; then + curl -o /root/cmake-3.22.tar.gz http://fileserver.pingcap.net/download/builds/pingcap/tiflash/ci-cache/cmake-3.22.3-linux-${ARCH}.tar.gz + cd /root + tar zxf cmake-3.22.tar.gz + rm -rf /usr/bin/cmake-3.22 + ln -s /root/cmake-3.22.3-linux-${ARCH}/bin/cmake /usr/bin/cmake-3.22 + rm cmake-3.22.tar.gz +fi +cmake-3.22 --version + CMAKE_BUILD_TYPE=$1 CMAKE_PREFIX_PATH=$2 @@ -29,7 +44,7 @@ ln -s ${SRCPATH}/contrib/tiflash-proxy/target/release/libtiflash_proxy.so ${SRCP 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-3.22 -S "${SRCPATH}" ${DEFINE_CMAKE_PREFIX_PATH} \ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ -DENABLE_EMBEDDED_COMPILER=${ENABLE_EMBEDDED_COMPILER} \ -DENABLE_ICU=OFF \ @@ -37,6 +52,7 @@ cmake "${SRCPATH}" ${DEFINE_CMAKE_PREFIX_PATH} \ -DENABLE_TESTING=OFF \ -DENABLE_TESTS=OFF \ -Wno-dev \ + -DUSE_INTERNAL_ZLIB_LIBRARY=OFF \ -DUSE_CCACHE=OFF make -j ${NPROC} tiflash diff --git a/release-centos7/build/build-tiflash-ut-coverage.sh b/release-centos7/build/build-tiflash-ut-coverage.sh index 32153f47a16..964bd3ebfef 100755 --- a/release-centos7/build/build-tiflash-ut-coverage.sh +++ b/release-centos7/build/build-tiflash-ut-coverage.sh @@ -1,5 +1,20 @@ #!/bin/bash +set -x + +ARCH=$(uname -p) + +command -v cmake-3.22 >/dev/null 2>&1 +if [[ $? != 0 ]]; then + curl -o /root/cmake-3.22.tar.gz http://fileserver.pingcap.net/download/builds/pingcap/tiflash/ci-cache/cmake-3.22.3-linux-${ARCH}.tar.gz + cd /root + tar zxf cmake-3.22.tar.gz + rm -rf /usr/bin/cmake-3.22 + ln -s /root/cmake-3.22.3-linux-${ARCH}/bin/cmake /usr/bin/cmake-3.22 + rm cmake-3.22.tar.gz +fi +cmake-3.22 --version + mkdir -p /build command -v ccache >/dev/null 2>&1 @@ -103,13 +118,14 @@ done BUILD_DIR="/build/release-centos7/build-release" rm -rf ${BUILD_DIR} mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} -cmake "${SRCPATH}" \ +cmake-3.22 -S "${SRCPATH}" \ -DENABLE_EMBEDDED_COMPILER=FALSE \ -DENABLE_TESTS=ON \ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ -DUSE_CCACHE=${USE_CCACHE} \ -DTEST_COVERAGE=ON \ -DTEST_COVERAGE_XML=ON \ + -DUSE_INTERNAL_ZLIB_LIBRARY=OFF \ -DDEBUG_WITHOUT_DEBUG_INFO=ON make -j ${NPROC} gtests_dbms gtests_libcommon gtests_libdaemon