Skip to content

Commit 7b6f849

Browse files
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.
1 parent 8897709 commit 7b6f849

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.travis.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
6767
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
6868
env:
69-
- COMPILER="ccache g++-5"
69+
- COMPILER="ccache /usr/bin/g++-5"
7070
- EXTRA_CXXFLAGS="-D_GLIBCXX_DEBUG"
7171

7272
# OS X using g++
@@ -76,10 +76,8 @@ jobs:
7676
compiler: gcc
7777
cache: ccache
7878
before_install:
79-
#we create symlink to non-ccache gcc, to be used in tests
80-
- mkdir bin ; ln -s /usr/bin/gcc bin/gcc
8179
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
82-
- export PATH=/usr/local/opt/ccache/libexec:$PATH
80+
- export PATH=$PATH:/usr/local/opt/ccache/libexec
8381
env: COMPILER="ccache g++"
8482

8583
# OS X using clang++
@@ -90,7 +88,7 @@ jobs:
9088
cache: ccache
9189
before_install:
9290
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
93-
- export PATH=/usr/local/opt/ccache/libexec:$PATH
91+
- export PATH=$PATH:/usr/local/opt/ccache/libexec
9492
env:
9593
- COMPILER="ccache clang++ -Qunused-arguments -fcolor-diagnostics"
9694
- CCACHE_CPP2=yes
@@ -113,7 +111,7 @@ jobs:
113111
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
114112
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
115113
env:
116-
- COMPILER="ccache g++-5"
114+
- COMPILER="ccache /usr/bin/g++-5"
117115
- EXTRA_CXXFLAGS="-DDEBUG"
118116
script: echo "Not running any tests for a debug build."
119117

@@ -138,7 +136,7 @@ jobs:
138136
- export CCACHE_CPP2=yes
139137
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
140138
env:
141-
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
139+
- COMPILER="ccache /usr/bin/clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
142140
- CCACHE_CPP2=yes
143141
- EXTRA_CXXFLAGS="-DNDEBUG"
144142

@@ -163,7 +161,7 @@ jobs:
163161
- export CCACHE_CPP2=yes
164162
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
165163
env:
166-
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
164+
- COMPILER="ccache /usr/bin/clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
167165
- CCACHE_CPP2=yes
168166
- EXTRA_CXXFLAGS="-DDEBUG -DUSE_STD_STRING"
169167
script: echo "Not running any tests for a debug build."
@@ -180,10 +178,12 @@ jobs:
180178
- ubuntu-toolchain-r-test
181179
packages:
182180
- g++-5
181+
before_install:
182+
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
183183
install:
184184
- ccache -z
185185
- ccache --max-size=1G
186-
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=g++-5'
186+
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/g++-5'
187187
- cmake --build build -- -j4
188188
script: (cd build; ctest -V -L CORE -j2)
189189

@@ -192,7 +192,7 @@ jobs:
192192
cache: ccache
193193
before_install:
194194
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
195-
- export PATH=/usr/local/opt/ccache/libexec:$PATH
195+
- export PATH=$PATH:/usr/local/opt/ccache/libexec
196196
env:
197197
- BUILD_SYSTEM=cmake
198198
- CCACHE_CPP2=yes

0 commit comments

Comments
 (0)