Skip to content

Commit

Permalink
Avoid double invoking ccache
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chrisr-diffblue committed Mar 3, 2018
1 parent 8897709 commit 7b6f849
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand All @@ -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++
Expand All @@ -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
Expand All @@ -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."

Expand All @@ -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"

Expand All @@ -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."
Expand All @@ -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)

Expand All @@ -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
Expand Down

0 comments on commit 7b6f849

Please sign in to comment.