Skip to contentSkip to conversation

CI: Add and use ccache in build-each-commit job

PATCH In review Anthony PERARD 3 participants 3 messages Jul 24, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CI: Add and use ccache in build-each-commit job

From: Anthony PERARD <[email protected]>

---

Notes:
The job build-each-commit is a bit faster, and can do about twice as much builds.

https://gitlab.com/xen-project/people/anthonyper/xen/-/jobs/10785719529

I haven't updated the container yet.

 automation/build/debian/12-x86_64.dockerfile | 3 +++
 automation/gitlab-ci/build-each-commit.sh    | 5 +++++
 2 files changed, 8 insertions(+)
automation/build/debian/12-x86_64.dockerfile +3 -0
index 6e0a403f64..e26a19079e 100644
@@ -54,6 +54,9 @@ RUN <<EOF
         expect
         qemu-system-x86
 
+        # for build-each-commit-gcc
+        ccache
+
         # for qemu-alpine-x86_64-gcc
         busybox-static
         cpio
automation/gitlab-ci/build-each-commit.sh +5 -0
index 08fddecbbe..166392fffd 100755
@@ -12,6 +12,11 @@ if [[ $? -ne 0 ]]; then
     exit 0
 fi
 
+if [ -d /usr/lib/ccache ]; then
+    echo "Building with ccache"
+    PATH="/usr/lib/ccache:$PATH"
+fi
+
 echo "Building ${BASE}..${TIP}"
 
 NON_SYMBOLIC_REF=1 ./automation/scripts/build-test.sh ${BASE} ${TIP} \
Signature · 1 line
Anthony PERARD
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Anthony PERARD

From: Anthony PERARD <[email protected]>

---

Quoted 7 lines

Notes:
The job build-each-commit is a bit faster, and can do about twice as much builds.

https://gitlab.com/xen-project/people/anthonyper/xen/-/jobs/10785719529

I haven't updated the container yet.

Very nice.

That's rather more simple to integrate than I was expecting.

~Andrew

#2 lore raw
Quoted 12 lines · Andrew Cooper
Quoted 11 lines · Anthony PERARD

From: Anthony PERARD <[email protected]>

---

Notes:
The job build-each-commit is a bit faster, and can do about twice as much builds.

https://gitlab.com/xen-project/people/anthonyper/xen/-/jobs/10785719529

Quoted 7 lines
Quoted 1 line

I haven't updated the container yet.

Very nice.

That's rather more simple to integrate than I was expecting.