Avoid double invoking ccache

In Travis, when jobs have the 'cache: ccache' option set, Travis
automatically adds the location of the ccache wrappers around g++/clang++
to the head of the PATH environment variable. This means that when you
invoke 'g++' or 'clang++' what you are actually invoking is ccache.
However, our jobs execute 'ccache g++', which means we are actually
invoking ccache on itself. This was causing very poor ccache hit rates.
This commit is contained in:
Chris Ryder 2018-03-03 09:33:44 +00:00
parent 88977098e3
commit 7b6f849458
1 changed files with 10 additions and 10 deletions

View File

@ -66,7 +66,7 @@ jobs:
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
env:
- COMPILER="ccache g++-5"
- COMPILER="ccache /usr/bin/g++-5"
- EXTRA_CXXFLAGS="-D_GLIBCXX_DEBUG"
# OS X using g++
@ -76,10 +76,8 @@ jobs:
compiler: gcc
cache: ccache
before_install:
#we create symlink to non-ccache gcc, to be used in tests
- mkdir bin ; ln -s /usr/bin/gcc bin/gcc
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
- export PATH=/usr/local/opt/ccache/libexec:$PATH
- export PATH=$PATH:/usr/local/opt/ccache/libexec
env: COMPILER="ccache g++"
# OS X using clang++
@ -90,7 +88,7 @@ jobs:
cache: ccache
before_install:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
- export PATH=/usr/local/opt/ccache/libexec:$PATH
- export PATH=$PATH:/usr/local/opt/ccache/libexec
env:
- COMPILER="ccache clang++ -Qunused-arguments -fcolor-diagnostics"
- CCACHE_CPP2=yes
@ -113,7 +111,7 @@ jobs:
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
env:
- COMPILER="ccache g++-5"
- COMPILER="ccache /usr/bin/g++-5"
- EXTRA_CXXFLAGS="-DDEBUG"
script: echo "Not running any tests for a debug build."
@ -138,7 +136,7 @@ jobs:
- export CCACHE_CPP2=yes
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
env:
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
- COMPILER="ccache /usr/bin/clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
- CCACHE_CPP2=yes
- EXTRA_CXXFLAGS="-DNDEBUG"
@ -163,7 +161,7 @@ jobs:
- export CCACHE_CPP2=yes
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
env:
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
- COMPILER="ccache /usr/bin/clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
- CCACHE_CPP2=yes
- EXTRA_CXXFLAGS="-DDEBUG -DUSE_STD_STRING"
script: echo "Not running any tests for a debug build."
@ -180,10 +178,12 @@ jobs:
- ubuntu-toolchain-r-test
packages:
- g++-5
before_install:
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
install:
- ccache -z
- ccache --max-size=1G
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=g++-5'
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/g++-5'
- cmake --build build -- -j4
script: (cd build; ctest -V -L CORE -j2)
@ -192,7 +192,7 @@ jobs:
cache: ccache
before_install:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
- export PATH=/usr/local/opt/ccache/libexec:$PATH
- export PATH=$PATH:/usr/local/opt/ccache/libexec
env:
- BUILD_SYSTEM=cmake
- CCACHE_CPP2=yes