Commit 29f9e6e2 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

travis: enable ccache for local builds

For now, it's done for local builds only (i.e. no per-arch Docker
builds yet). The reason is, it's easier to play with ccache when
the compiles are (relatively) fast.

Performance: there is 2x to 3x improvement in build speeds for
ideal cases (same code, hot cache), but the absolute savings
are negligible (example: 7 seconds instead of 23).

Note that ccache is not compatible with gcov, so we only enable it
for non-gcov build (which happens to be the one with clang).
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent c903ddfc
language: c language: c
sudo: required sudo: required
dist: trusty dist: trusty
cache: ccache
services: services:
- docker - docker
env: env:
...@@ -16,6 +17,7 @@ env: ...@@ -16,6 +17,7 @@ env:
- TR_ARCH=ppc64le CLANG=1 - TR_ARCH=ppc64le CLANG=1
- TR_ARCH=alpine CLANG=1 - TR_ARCH=alpine CLANG=1
script: script:
- sudo make -C scripts/travis $TR_ARCH - sudo make CCACHE=1 -C scripts/travis $TR_ARCH
after_success: after_success:
- ccache -s
- make -C scripts/travis after_success - make -C scripts/travis after_success
...@@ -13,12 +13,25 @@ travis_prep () { ...@@ -13,12 +13,25 @@ travis_prep () {
service apport stop service apport stop
CC=gcc
# clang support
if [ "$CLANG" = "1" ]; then
TRAVIS_PKGS="$TRAVIS_PKGS clang"
CC=clang
fi
# ccache support, only enable for non-GCOV case
if [ "$CCACHE" = "1" -a -z "$GCOV" ]; then
# ccache is installed by default, need to set it up
export CCACHE_DIR=$HOME/.ccache
[ "$CC" = "clang" ] && export CCACHE_CPP2=yes
# uncomment the following to get detailed ccache logs
#export CCACHE_LOGFILE=$HOME/ccache.log
CC="ccache $CC"
fi
apt-get update -qq apt-get update -qq
apt-get install -qq $TRAVIS_PKGS apt-get install -qq $TRAVIS_PKGS
if [ "$CLANG" = "1" ]; then
apt-get install -qq clang
MAKE_VARS=CC=clang
fi
chmod a+x $HOME chmod a+x $HOME
} }
...@@ -28,8 +41,10 @@ ulimit -c unlimited ...@@ -28,8 +41,10 @@ ulimit -c unlimited
echo "|`pwd`/test/abrt.sh %P %p %s %e" > /proc/sys/kernel/core_pattern echo "|`pwd`/test/abrt.sh %P %p %s %e" > /proc/sys/kernel/core_pattern
export GCOV export GCOV
make ${MAKE_VARS} time make CC="$CC" -j4
make ${MAKE_VARS} -C test/zdtm time make CC="$CC" -j4 -C test/zdtm
[ -f "$CCACHE_LOGFILE" ] && cat $CCACHE_LOGFILE
./criu/criu check ./criu/criu check
./criu/criu check --all || echo $? ./criu/criu check --all || echo $?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment