Skip to content

Commit

Permalink
MSYS2 : (re)enable ccache in appveyor (#6572)
Browse files Browse the repository at this point in the history
  • Loading branch information
oxillo authored Apr 17, 2020
1 parent f23c71d commit 6c9654b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
13 changes: 12 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,7 +18,6 @@ environment:
platform: x64
BUILDER: MSYS2
MSYSTEM: MINGW64

#VisualStudio Building
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
platform: x86
Expand All @@ -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")
Expand All @@ -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")
9 changes: 3 additions & 6 deletions scripts/ci/ccache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion scripts/ci/msys2/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6c9654b

Please sign in to comment.