From b42299b147c5ef7b590c2650e41d1dd8ce50096b Mon Sep 17 00:00:00 2001 From: David Wagner Date: Thu, 25 Feb 2016 17:40:33 +0100 Subject: [PATCH 1/4] Travis: Use CCache Speeds up the build. Signed-off-by: David Wagner --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index db18b6f98..491bf9c8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ # Use travis docker infrastructure sudo: false language: cpp +cache: ccache env: global: From ef833e2139c68d446d87baa3f05932f11b763395 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Thu, 25 Feb 2016 18:14:50 +0100 Subject: [PATCH 2/4] Travis/CCache: manually add /usr/lib/ccache to the PATH A PR is ongoing on travis-build to do it automatically: https://github.com/travis-ci/travis-build/pull/655 Signed-off-by: David Wagner --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 491bf9c8b..37489c738 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ cache: ccache env: global: - PREFIX=$HOME/prefix + - PATH=/usr/lib/ccache:$PATH compiler: - gcc From be343978343dff24c4d3a1ac7d9cc6344979680d Mon Sep 17 00:00:00 2001 From: David Wagner Date: Thu, 25 Feb 2016 18:58:56 +0100 Subject: [PATCH 3/4] Travis/CCache: workaround a ccache bug with g++-4.8.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From ccache's manual: If compilation doesn’t work with ccache, but it works without it, one possible reason is that the compiler can’t compile preprocessed output correctly. A workaround that may work is to set CCACHE_CPP2. Signed-off-by: David Wagner --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 37489c738..760f3a433 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,9 +49,11 @@ before_script: - coverage=OFF # Force the manualy installed 4.8 version as it is not the default # Only enable coverage on gcc as clang segfault on coverage file write + # Workaround a bug with the ccache/g++-4.8.1 combination - if [ "$CC" = "gcc" ]; then export CC=gcc-4.8 CXX=g++-4.8; coverage=ON; + export CCACHE_CPP2=1; fi # how to build From 34cc030ff87c2b29642cf07634e74eaa4c04f649 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Fri, 26 Feb 2016 10:21:21 +0100 Subject: [PATCH 4/4] travis: build with -j$(nproc) instead of -j It is more sensible and may give better results on some setups. Signed-off-by: David Wagner --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 760f3a433..9fd818cb9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,17 +64,17 @@ script: - ( mkdir build_debug && cd build_debug && cmake -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=${coverage} .. && - make -j && + make -j$(nproc) && CTEST_OUTPUT_ON_FAILURE=1 make ExperimentalTest ExperimentalMemCheck ) - ( mkdir build && cd build && cmake -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=Release .. && - make -j && + make -j$(nproc) && CTEST_OUTPUT_ON_FAILURE=1 make test && make install && cpack --verbose -G DEB && dpkg --info *.deb) - ( cd skeleton-subsystem && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install . && - make && + make -j$(nproc) && CTEST_OUTPUT_ON_FAILURE=1 make ExperimentalTest ExperimentalMemCheck && make install ) - ( cd tools/clientSimulator && @@ -88,7 +88,7 @@ script: rm -rf $PREFIX/asio-1.10.6 && cmake -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_BUILD_TYPE=Debug -DNETWORKING=OFF -DPYTHON_BINDINGS=OFF -DC_BINDINGS=OFF .. && - make -j && + make -j$(nproc) && CTEST_OUTPUT_ON_FAILURE=1 make test ) after_success: