ci: Enable ccache in the container builds.
authorEric Anholt <eric@anholt.net>
Fri, 6 Mar 2020 21:23:20 +0000 (13:23 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 17 Mar 2020 17:44:39 +0000 (10:44 -0700)
This should reduce our container rebuild times, particularly on the
40-minute ARM build (which is split across only 2 runners and thus likely
to have a hot cache) when working on updating containers.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4099>

.gitlab-ci/container/arm_build.sh
.gitlab-ci/container/arm_test.sh
.gitlab-ci/container/container_post_build.sh [new file with mode: 0755]
.gitlab-ci/container/container_pre_build.sh [new file with mode: 0755]
.gitlab-ci/container/x86_build.sh
.gitlab-ci/container/x86_build_old.sh
.gitlab-ci/container/x86_test-gl.sh
.gitlab-ci/container/x86_test-vk.sh

index dd6ea1a16ccdf0284c7e04ce22306acc7dc4007f..fc1947fbdbf96569a6580dbbaebda5a2a99cfa7a 100644 (file)
@@ -52,6 +52,8 @@ apt-get -y install \
        xz-utils \
        zlib1g-dev
 
+. .gitlab-ci/container/container_pre_build.sh
+
 # dependencies where we want a specific version
 export LIBDRM_VERSION=libdrm-2.4.100
 
@@ -78,4 +80,4 @@ apt-get purge -y \
         python3-distutils \
         wget
 
-apt-get autoremove -y --purge
+. .gitlab-ci/container/container_post_build.sh
index 6f91da724ab702e2efafbe48df5faea312717cd4..36f85490b1bd07ef74ba86bf4e9244bd5347cd5c 100644 (file)
@@ -10,6 +10,7 @@ echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources
 apt-get update
 apt-get -y install \
        bzip2 \
+       ccache \
        cmake \
        g++ \
        gcc \
@@ -35,6 +36,8 @@ apt-get -y install \
        wget \
        zlib1g
 
+. .gitlab-ci/container/container_pre_build.sh
+
 ############### Build dEQP runner
 
 . .gitlab-ci/build-cts-runner.sh
@@ -46,8 +49,11 @@ apt-get -y install \
 
 ############### Uninstall the build software
 
+ccache --show-stats
+
 apt-get purge -y \
         bzip2 \
+        ccache \
         cmake \
         g++ \
         gcc \
diff --git a/.gitlab-ci/container/container_post_build.sh b/.gitlab-ci/container/container_post_build.sh
new file mode 100755 (executable)
index 0000000..5647e13
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+apt-get autoremove -y --purge
+
+ccache --show-stats
diff --git a/.gitlab-ci/container/container_pre_build.sh b/.gitlab-ci/container/container_pre_build.sh
new file mode 100755 (executable)
index 0000000..daae18f
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+export CCACHE_COMPILERCHECK=content
+export CCACHE_COMPRESS=true
+export CCACHE_DIR=/cache/mesa/ccache
+export PATH=/usr/lib/ccache:$PATH
+
+ccache --show-stats
index 46623472d0c559ddcac609a0b64bb184e7989d97..7a14e9315d834b3f79e88241e1fd8933cea6d455 100644 (file)
@@ -84,6 +84,8 @@ apt-get install -y --no-remove \
       xz-utils \
       zlib1g-dev
 
+. .gitlab-ci/container/container_pre_build.sh
+
 # Cross-build Mesa deps
 for arch in $CROSS_ARCHITECTURES; do
     apt-get install -y --no-remove \
@@ -219,10 +221,6 @@ make -j4
 popd
 
 
-# Remove ccache directory, useless for the build jobs
-rm -rf $(ccache --get-config=cache_dir)
-
-
 ############### Uninstall the build software
 
 apt-get purge -y \
@@ -237,4 +235,4 @@ apt-get purge -y \
       unzip \
       wget
 
-apt-get autoremove -y --purge
+. .gitlab-ci/container/container_post_build.sh
index 96a75107a835295080360b2053619ac92f1154d2..6f6f228bbb94473992a598d3e69c8c3ddda77cce 100644 (file)
@@ -53,7 +53,8 @@ apt-get install -y --no-remove \
       xz-utils \
       zlib1g-dev
 
+. .gitlab-ci/container/container_pre_build.sh
 
 ############### Uninstall unused packages
 
-apt-get autoremove -y --purge
+. .gitlab-ci/container/container_post_build.sh
index 747e0b21166351a574700df4f0493d554b393b35..ea76876c281c93dbdb15301cc25ad516671b0bba 100644 (file)
@@ -30,6 +30,7 @@ apt-get dist-upgrade -y
 apt-get install -y --no-remove \
       autoconf \
       automake \
+      ccache \
       cmake \
       g++ \
       gcc \
@@ -75,6 +76,7 @@ apt-get install -y --no-remove \
       xvfb \
       zlib1g
 
+. .gitlab-ci/container/container_pre_build.sh
 
 ############### Build piglit
 
@@ -98,9 +100,12 @@ apt-get install -y --no-remove \
 
 ############### Uninstall the build software
 
+ccache --show-stats
+
 apt-get purge -y \
       autoconf \
       automake \
+      ccache \
       cmake \
       g++ \
       gcc \
index 08a38d3539aeab327a16a848471b8b99e5d28977..ba52eea32bca290c9e16f0655245b307042b93bb 100644 (file)
@@ -28,6 +28,7 @@ EOF
 apt-get dist-upgrade -y
 
 apt-get install -y --no-remove \
+      ccache \
       cmake \
       g++ \
       gcc \
@@ -66,6 +67,7 @@ apt-get install -y --no-remove \
       xauth \
       xvfb
 
+. .gitlab-ci/container/container_pre_build.sh
 
 ############### Build dEQP runner
 
@@ -89,7 +91,10 @@ apt-get install -y --no-remove \
 
 ############### Uninstall the build software
 
+ccache --show-stats
+
 apt-get purge -y \
+      ccache \
       cmake \
       g++ \
       gcc \