From 6c9654bd9e0f31ab96162097155aa58e84bb6ed5 Mon Sep 17 00:00:00 2001 From: Olivier XILLO Date: Fri, 17 Apr 2020 11:33:07 +0200 Subject: [PATCH] MSYS2 : (re)enable ccache in appveyor (#6572) --- .appveyor.yml | 13 ++++++++++++- scripts/ci/ccache.sh | 9 +++------ scripts/ci/msys2/install.sh | 4 +++- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index dcc50f9df26..8505a12ec02 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -5,6 +5,9 @@ environment: APPVEYOR_OS_NAME: windows CHERE_INVOKING: 1 MSYS2_PATH: c:\msys64 + #CCACHE settings : Appveyor cache is limited to 1G so we limit CCACHE to 2G and expect 50% compression... + CCACHE_DIR: "%APPVEYOR_BUILD_FOLDER%\\.ccache" + CCACHE_MAXSIZE: 2G matrix: #MSYS2 Building - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 @@ -15,7 +18,6 @@ environment: platform: x64 BUILDER: MSYS2 MSYSTEM: MINGW64 - #VisualStudio Building - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 platform: x86 @@ -42,10 +44,16 @@ init: # - IF "%BUILDER%"=="VS" set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% +cache: + - .ccache + install: - if "%BUILDER%"=="VS" (%MSYS2_PATH%\usr\bin\bash -lc "scripts/ci/vs/install.sh") - if "%BUILDER%"=="MSYS2" (%MSYS2_PATH%\usr\bin\bash -lc "scripts/ci/msys2/install.sh") +before_build: +#- if "%BUILDER%"=="MSYS2" (%MSYS2_PATH%\usr\bin\bash -lc "ccache -z") +- if "%BUILDER%"=="MSYS2" (%MSYS2_PATH%\usr\bin\bash -lc "ccache -s") build_script: - if "%BUILDER%"=="MSYS2" (%MSYS2_PATH%\usr\bin\bash -lc "scripts/ci/msys2/build.sh") @@ -64,3 +72,6 @@ test_script: cd scripts/ci/vs .\run_tests.bat } + +after_test: + - if "%BUILDER%"=="MSYS2" (%MSYS2_PATH%\usr\bin\bash -lc "ccache -s") \ No newline at end of file diff --git a/scripts/ci/ccache.sh b/scripts/ci/ccache.sh index b49d738c100..a41811e8e45 100644 --- a/scripts/ci/ccache.sh +++ b/scripts/ci/ccache.sh @@ -19,12 +19,9 @@ EOF2 export CXX="$PWD/clang++.sh" export CC="$PWD/clang.sh" -elif [ "$BUILDER" == "msys2" ]; then -# echo "detected msys setting ccache as env var" -# export CC="ccache /mingw32/bin/gcc" -# export CXX="ccache /mingw32/bin/g++" -# USE_CCACHE="USE_CCACHE=1" - echo "ccache is disable in MSYS2" +elif [ "$BUILDER" == "MSYS2" ]; then + echo "detected msys setting ccache as env var" + USE_CCACHE="USE_CCACHE=1" else export PATH="/usr/lib/ccache:$PATH" fi diff --git a/scripts/ci/msys2/install.sh b/scripts/ci/msys2/install.sh index 9bc4f5c9cc8..7b71a058b01 100644 --- a/scripts/ci/msys2/install.sh +++ b/scripts/ci/msys2/install.sh @@ -4,4 +4,6 @@ ROOT=$(pwd -P) $ROOT/scripts/msys2/install_dependencies.sh --noconfirm $ROOT/scripts/msys2/download_libs.sh --silent -pacman -S --noconfirm ccache +if [[ $MINGW_PACKAGE_PREFIX ]]; then + pacman -S --noconfirm $MINGW_PACKAGE_PREFIX-ccache +fi