From a74a7e5dfe228092eca40080053949647c3cf505 Mon Sep 17 00:00:00 2001 From: Francisco Ferreira Date: Tue, 17 May 2016 06:16:42 +0100 Subject: [PATCH] ci: update ccache and improve its support Update ccache to 3.2.5 Set ccache size Display ccache statistics for each build Disable ccache for configure phase Export ccache bin path travis: remove ccache stats before saving cache --- .travis.yml | 3 +++ Tools/scripts/build_ci.sh | 9 +++++++++ Tools/scripts/configure-ci.sh | 6 +++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8b70f2d8ec..3360b08919 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,6 +45,9 @@ script: - python Tools/autotest/param_metadata/param_parse.py - Tools/scripts/build_ci.sh +before_cache: + - ccache -z + notifications: webhooks: urls: diff --git a/Tools/scripts/build_ci.sh b/Tools/scripts/build_ci.sh index 20c4a4693e..117fa8968a 100755 --- a/Tools/scripts/build_ci.sh +++ b/Tools/scripts/build_ci.sh @@ -28,6 +28,12 @@ if [ -z "$CI_BUILD_TARGET" ]; then CI_BUILD_TARGET="sitl linux px4-v2" fi +if [[ "$CI_BUILD_TARGET" == *"px4"* ]]; then + export CCACHE_MAXSIZE="1500M" +else + export CCACHE_MAXSIZE="500M" +fi + # special case for SITL testing in CI if [ "$CI_BUILD_TARGET" = "sitltest" ]; then echo "Installing pymavlink" @@ -64,6 +70,7 @@ for t in $CI_BUILD_TARGET; do fi make $t -j2 + ccache -s && ccache -z popd done @@ -86,6 +93,8 @@ for t in $CI_BUILD_TARGET; do $waf configure --board $t --enable-benchmarks --check-c-compiler="$c_compiler" --check-cxx-compiler="$cxx_compiler" $waf clean $waf -j2 all + ccache -s && ccache -z + if [[ $t == linux ]]; then $waf check fi diff --git a/Tools/scripts/configure-ci.sh b/Tools/scripts/configure-ci.sh index 6a6ad39ec9..b6c0f48277 100755 --- a/Tools/scripts/configure-ci.sh +++ b/Tools/scripts/configure-ci.sh @@ -3,13 +3,16 @@ set -ex +# Disable ccache for the configure phase, it's not worth it +export CCACHE_DISABLE="true" + ARM_ROOT="gcc-arm-none-eabi-4_9-2015q3" ARM_TARBALL="$ARM_ROOT-20150921-linux.tar.bz2" RPI_ROOT="master" RPI_TARBALL="$RPI_ROOT.tar.gz" -CCACHE_ROOT="ccache-3.2.4" +CCACHE_ROOT="ccache-3.2.5" CCACHE_TARBALL="$CCACHE_ROOT.tar.bz2" mkdir -p $HOME/opt @@ -68,6 +71,7 @@ exportline="export PATH=$HOME/ccache" exportline="${exportline}:$HOME/bin" exportline="${exportline}:$HOME/opt/gcc-arm-none-eabi-4_9-2015q3/bin" exportline="${exportline}:$HOME/opt/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin" +exportline="${exportline}:$HOME/opt/$CCACHE_ROOT" exportline="${exportline}:\$PATH" if grep -Fxq "$exportline" ~/.profile; then