mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
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: Kir Kolyshkin <kir@openvz.org> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
c903ddfcf1
commit
29f9e6e2f1
2 changed files with 24 additions and 7 deletions
|
|
@ -1,6 +1,7 @@
|
|||
language: c
|
||||
sudo: required
|
||||
dist: trusty
|
||||
cache: ccache
|
||||
services:
|
||||
- docker
|
||||
env:
|
||||
|
|
@ -16,6 +17,7 @@ env:
|
|||
- TR_ARCH=ppc64le CLANG=1
|
||||
- TR_ARCH=alpine CLANG=1
|
||||
script:
|
||||
- sudo make -C scripts/travis $TR_ARCH
|
||||
- sudo make CCACHE=1 -C scripts/travis $TR_ARCH
|
||||
after_success:
|
||||
- ccache -s
|
||||
- make -C scripts/travis after_success
|
||||
|
|
|
|||
|
|
@ -13,12 +13,25 @@ travis_prep () {
|
|||
|
||||
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 install -qq $TRAVIS_PKGS
|
||||
if [ "$CLANG" = "1" ]; then
|
||||
apt-get install -qq clang
|
||||
MAKE_VARS=CC=clang
|
||||
fi
|
||||
chmod a+x $HOME
|
||||
}
|
||||
|
||||
|
|
@ -28,8 +41,10 @@ ulimit -c unlimited
|
|||
echo "|`pwd`/test/abrt.sh %P %p %s %e" > /proc/sys/kernel/core_pattern
|
||||
|
||||
export GCOV
|
||||
make ${MAKE_VARS}
|
||||
make ${MAKE_VARS} -C test/zdtm
|
||||
time make CC="$CC" -j4
|
||||
time make CC="$CC" -j4 -C test/zdtm
|
||||
|
||||
[ -f "$CCACHE_LOGFILE" ] && cat $CCACHE_LOGFILE
|
||||
|
||||
./criu/criu check
|
||||
./criu/criu check --all || echo $?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue