[Skiboot] [PATCH 1/3] travis: enable ccache

Stewart Smith stewart at linux.vnet.ibm.com
Thu Nov 17 09:31:44 AEDT 2016


Primarily this combats the long time it takes to build qemu in
our build scripts. Practically, cuts a couple of minutes from build.

Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 .travis.yml                      | 4 +++-
 opal-ci/Dockerfile-centos6       | 2 +-
 opal-ci/Dockerfile-centos7       | 2 +-
 opal-ci/Dockerfile-fedora24      | 2 +-
 opal-ci/Dockerfile-ubuntu-12.04  | 2 +-
 opal-ci/Dockerfile-ubuntu-16.04  | 2 +-
 opal-ci/Dockerfile-ubuntu-latest | 2 +-
 opal-ci/build-qemu-powernv.sh    | 2 ++
 8 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 87e4ec2..a986d07 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,7 @@
 language: c
 
+cache: ccache
+
 env:
     matrix:
     - RUN_ON_CONTAINER=ubuntu-12.04
@@ -28,7 +30,7 @@ before_install:
 script:
     - if [ ${COVERITY_SCAN_BRANCH} != 1 ]; then
        docker build -t ${RUN_ON_CONTAINER} -f opal-ci/Dockerfile-${RUN_ON_CONTAINER} . &&
-       docker run --rm -t $RUN_ON_CONTAINER;
+       docker run --volume $HOME/.ccache:/root/.ccache --rm -t $RUN_ON_CONTAINER;
       fi
     - if [ ${COVERITY_SCAN_BRANCH} == 1 ]; then
         sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test &&
diff --git a/opal-ci/Dockerfile-centos6 b/opal-ci/Dockerfile-centos6
index 5cd9a7a..d4cf436 100644
--- a/opal-ci/Dockerfile-centos6
+++ b/opal-ci/Dockerfile-centos6
@@ -1,6 +1,6 @@
 FROM centos:6
 RUN yum -y update && yum clean all
-RUN yum -y install wget xterm gcc git xz
+RUN yum -y install wget xterm gcc git xz ccache
 RUN wget https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.8.0/x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz
 RUN mkdir /opt/cross
 RUN tar -C /opt/cross -xf x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz
diff --git a/opal-ci/Dockerfile-centos7 b/opal-ci/Dockerfile-centos7
index c9d4c87..47e9138 100644
--- a/opal-ci/Dockerfile-centos7
+++ b/opal-ci/Dockerfile-centos7
@@ -1,6 +1,6 @@
 FROM centos:7
 RUN yum -y update && yum clean all
-RUN yum -y install wget xterm gcc git xz make diffutils findutils expect valgrind valgrind-devel
+RUN yum -y install wget xterm gcc git xz make diffutils findutils expect valgrind valgrind-devel ccache
 RUN wget https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.8.0/x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz
 RUN mkdir /opt/cross
 RUN tar -C /opt/cross -xf x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz
diff --git a/opal-ci/Dockerfile-fedora24 b/opal-ci/Dockerfile-fedora24
index 7caa884..d92affd 100644
--- a/opal-ci/Dockerfile-fedora24
+++ b/opal-ci/Dockerfile-fedora24
@@ -1,5 +1,5 @@
 FROM fedora:24
-RUN dnf -y install wget xterm gcc git xz make diffutils findutils expect valgrind valgrind-devel
+RUN dnf -y install wget xterm gcc git xz make diffutils findutils expect valgrind valgrind-devel ccache
 RUN dnf -y install gcc-powerpc64-linux-gnu 
 COPY . /build/
 WORKDIR /build
diff --git a/opal-ci/Dockerfile-ubuntu-12.04 b/opal-ci/Dockerfile-ubuntu-12.04
index 42026a2..fd7bd09 100644
--- a/opal-ci/Dockerfile-ubuntu-12.04
+++ b/opal-ci/Dockerfile-ubuntu-12.04
@@ -3,7 +3,7 @@ RUN sudo apt-get update -qq
 RUN sudo apt-get install -y software-properties-common
 RUN sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
 RUN sudo apt-get update -qq
-RUN sudo apt-get install -y gcc-4.8 libstdc++6 valgrind expect xterm
+RUN sudo apt-get install -y gcc-4.8 libstdc++6 valgrind expect xterm ccache
 RUN sudo apt-get install -y gcc-arm-linux-gnueabi gcc-powerpc64le-linux-gnu gcc
 RUN sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
 RUN sudo apt-get install -y wget
diff --git a/opal-ci/Dockerfile-ubuntu-16.04 b/opal-ci/Dockerfile-ubuntu-16.04
index 2fb299b..8dea58d 100644
--- a/opal-ci/Dockerfile-ubuntu-16.04
+++ b/opal-ci/Dockerfile-ubuntu-16.04
@@ -1,6 +1,6 @@
 FROM ubuntu:16.04
 RUN apt-get update -qq
-RUN apt-get install -y gcc-powerpc64le-linux-gnu gcc
+RUN apt-get install -y gcc-powerpc64le-linux-gnu gcc ccache
 RUN apt-get install -y wget xterm
 RUN apt-get install -y gcc-arm-linux-gnueabi
 RUN wget ftp://public.dhe.ibm.com/software/server/powerfuncsim/p8/packages/v1.0-2/systemsim-p8_1.0-2_amd64.deb
diff --git a/opal-ci/Dockerfile-ubuntu-latest b/opal-ci/Dockerfile-ubuntu-latest
index 28fb904..683a5a1 100644
--- a/opal-ci/Dockerfile-ubuntu-latest
+++ b/opal-ci/Dockerfile-ubuntu-latest
@@ -1,6 +1,6 @@
 FROM ubuntu:latest
 RUN apt-get update -qq
-RUN apt-get install -y gcc-powerpc64le-linux-gnu gcc
+RUN apt-get install -y gcc-powerpc64le-linux-gnu gcc ccache
 RUN apt-get install -y wget xterm
 RUN apt-get install -y gcc-arm-linux-gnueabi
 RUN wget ftp://public.dhe.ibm.com/software/server/powerfuncsim/p8/packages/v1.0-2/systemsim-p8_1.0-2_amd64.deb
diff --git a/opal-ci/build-qemu-powernv.sh b/opal-ci/build-qemu-powernv.sh
index 3b03853..cbd72d3 100755
--- a/opal-ci/build-qemu-powernv.sh
+++ b/opal-ci/build-qemu-powernv.sh
@@ -4,5 +4,7 @@ set -e
 git clone --depth=1 -b qemu-powernv-for-skiboot-3 git://github.com/open-power/qemu.git
 cd qemu
 git submodule update --init dtc
+export CC="ccache gcc"
+export CXX="ccache g++"
 ./configure --target-list=ppc64-softmmu --disable-werror
 make -j `grep -c processor /proc/cpuinfo`
-- 
2.7.4



More information about the Skiboot mailing list