From 7683b6ad2d9ea1335fe383335d2f9c00bae426dd Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Fri, 11 Oct 2024 04:03:26 +0000 Subject: [PATCH] update --- .../linux/build_linux_python_package.sh | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/tools/ci_build/github/linux/build_linux_python_package.sh b/tools/ci_build/github/linux/build_linux_python_package.sh index 371bf04df295..e8aeb3b60ada 100755 --- a/tools/ci_build/github/linux/build_linux_python_package.sh +++ b/tools/ci_build/github/linux/build_linux_python_package.sh @@ -33,30 +33,32 @@ if [ "$BUILD_CONFIG" != "Debug" ]; then fi if [ "$ENABLE_CACHE" = true ] ; then BUILD_ARGS+=("--use_cache") + # No release binary for ccache aarch64, so we need to build it from source. + if ! [ -x "$(command -v ccache)" ]; then + ccache_url="https://github.com/ccache/ccache/archive/refs/tags/v4.8.tar.gz" + pushd . + curl -sSL --retry 5 --retry-delay 10 --create-dirs --fail -L -o ccache_src.tar.gz $ccache_url + mkdir ccache_main + cd ccache_main + tar -zxf ../ccache_src.tar.gz --strip=1 + + mkdir build + cd build + cmake -DCMAKE_INSTALL_PREFIX=/build -DCMAKE_BUILD_TYPE=Release .. + make -j$(nproc) + make install + export PATH=/build/bin:$PATH + which ccache + popd + rm -f ccache_src.tar.gz + rm -rf ccache_src + fi + ccache -s; fi ARCH=$(uname -m) -# No release binary for ccache aarch64, so we need to build it from source. -if ! [ -x "$(command -v ccache)" ]; then - ccache_url="https://github.com/ccache/ccache/archive/refs/tags/v4.8.tar.gz" - pushd . - curl -sSL --retry 5 --retry-delay 10 --create-dirs --fail -L -o ccache_src.tar.gz $ccache_url - mkdir ccache_main - cd ccache_main - tar -zxf ../ccache_src.tar.gz --strip=1 - - mkdir build - cd build - cmake -DCMAKE_INSTALL_PREFIX=/build -DCMAKE_BUILD_TYPE=Release .. - make -j$(nproc) - make install - export PATH=/build/bin:$PATH - which ccache - popd - rm -f ccache_src.tar.gz - rm -rf ccache_src -fi + echo "EXTRA_ARG:" @@ -94,4 +96,6 @@ do cp /build/"$BUILD_CONFIG"/dist/*.whl /build/dist done -which ccache && ccache -sv && ccache -z +if [ "$ENABLE_CACHE" = true ] ; then + which ccache && ccache -sv && ccache -z +fi