From: Eric Anholt Date: Fri, 6 Mar 2020 21:23:20 +0000 (-0800) Subject: ci: Enable ccache in the container builds. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ba39cc5e85ef3b2c14803d21f6fe437620432227;p=mesa.git ci: Enable ccache in the container builds. 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 Part-of: --- diff --git a/.gitlab-ci/container/arm_build.sh b/.gitlab-ci/container/arm_build.sh index dd6ea1a16cc..fc1947fbdbf 100644 --- a/.gitlab-ci/container/arm_build.sh +++ b/.gitlab-ci/container/arm_build.sh @@ -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 diff --git a/.gitlab-ci/container/arm_test.sh b/.gitlab-ci/container/arm_test.sh index 6f91da724ab..36f85490b1b 100644 --- a/.gitlab-ci/container/arm_test.sh +++ b/.gitlab-ci/container/arm_test.sh @@ -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 index 00000000000..5647e13cbd9 --- /dev/null +++ b/.gitlab-ci/container/container_post_build.sh @@ -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 index 00000000000..daae18fccb9 --- /dev/null +++ b/.gitlab-ci/container/container_pre_build.sh @@ -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 diff --git a/.gitlab-ci/container/x86_build.sh b/.gitlab-ci/container/x86_build.sh index 46623472d0c..7a14e9315d8 100644 --- a/.gitlab-ci/container/x86_build.sh +++ b/.gitlab-ci/container/x86_build.sh @@ -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 diff --git a/.gitlab-ci/container/x86_build_old.sh b/.gitlab-ci/container/x86_build_old.sh index 96a75107a83..6f6f228bbb9 100644 --- a/.gitlab-ci/container/x86_build_old.sh +++ b/.gitlab-ci/container/x86_build_old.sh @@ -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 diff --git a/.gitlab-ci/container/x86_test-gl.sh b/.gitlab-ci/container/x86_test-gl.sh index 747e0b21166..ea76876c281 100644 --- a/.gitlab-ci/container/x86_test-gl.sh +++ b/.gitlab-ci/container/x86_test-gl.sh @@ -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 \ diff --git a/.gitlab-ci/container/x86_test-vk.sh b/.gitlab-ci/container/x86_test-vk.sh index 08a38d3539a..ba52eea32bc 100644 --- a/.gitlab-ci/container/x86_test-vk.sh +++ b/.gitlab-ci/container/x86_test-vk.sh @@ -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 \