[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[NOTFORMERGE PATCH v2 3/3] gitlab-ci-edk2.yml: Use ccache
From: |
Philippe Mathieu-Daudé |
Subject: |
[NOTFORMERGE PATCH v2 3/3] gitlab-ci-edk2.yml: Use ccache |
Date: |
Tue, 7 Jan 2020 16:31:54 +0100 |
By using ccache we reduce the job duration from
36 minutes 28 seconds: https://gitlab.com/philmd/qemu/-/jobs/395823729
to
29 minutes 15 seconds: https://gitlab.com/philmd/qemu/-/jobs/395840851
Running after script...
$ ccache --show-stats
cache hit (direct) 6604
files in cache 12090
cache size 335.5 MB
For now downloading this cache takes 16 seconds, archiving
it 44 seconds.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
We prefer to not use ccache to build the EDK2 firmware binaries, see:
https://www.mail-archive.com/address@hidden/msg668616.html
.gitlab-ci-edk2.yml | 13 +++++++++++--
.gitlab-ci.d/edk2/Dockerfile | 3 +++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.gitlab-ci-edk2.yml b/.gitlab-ci-edk2.yml
index 088ba4b43a..50b8aee6b7 100644
--- a/.gitlab-ci-edk2.yml
+++ b/.gitlab-ci-edk2.yml
@@ -10,7 +10,7 @@ docker-edk2:
- docker:19.03.1-dind
variables:
GIT_DEPTH: 3
- IMAGE_TAG: $CI_REGISTRY_IMAGE:edk2-cross-build
+ IMAGE_TAG: $CI_REGISTRY_IMAGE:edk2-cross-build-ccache
# We don't use TLS
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
@@ -38,12 +38,21 @@ build-edk2:
- pc-bios/edk2-licenses.txt
- edk2-stdout.log
- edk2-stderr.log
- image: $CI_REGISTRY_IMAGE:edk2-cross-build
+ image: $CI_REGISTRY_IMAGE:edk2-cross-build-ccache
variables:
GIT_DEPTH: 3
+ CCACHE_DIR: ${CI_PROJECT_DIR}/.ccache
+ cache: # Use the same cache for all EDK2 jobs
+ key: edk2-cross-build-ccache
+ paths:
+ - ${CCACHE_DIR}
+ before_script:
+ - ccache --zero-stats
script: # Clone the required submodules and build EDK2
- git submodule update --init roms/edk2
- git -C roms/edk2 submodule update --init
- export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
- echo "=== Using ${JOBS} simultaneous jobs ==="
- make -j${JOBS} -C roms efi 2>&1 1>edk2-stdout.log | tee -a edk2-stderr.log
>&2
+ after_script:
+ - ccache --show-stats
diff --git a/.gitlab-ci.d/edk2/Dockerfile b/.gitlab-ci.d/edk2/Dockerfile
index b4584d1cf6..350b4df240 100644
--- a/.gitlab-ci.d/edk2/Dockerfile
+++ b/.gitlab-ci.d/edk2/Dockerfile
@@ -13,6 +13,7 @@ RUN apt update \
apt install --assume-yes --no-install-recommends \
build-essential \
ca-certificates \
+ ccache \
dos2unix \
gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabi \
@@ -25,3 +26,5 @@ RUN apt update \
&& \
\
rm -rf /var/lib/apt/lists/*
+
+ENV PATH /usr/lib/ccache:$PATH
--
2.21.1