[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/7] gitlab: enable ccache with Cirrus CI
From: |
Daniel P . Berrangé |
Subject: |
[PATCH 5/7] gitlab: enable ccache with Cirrus CI |
Date: |
Wed, 4 Dec 2024 19:48:05 +0000 |
Add rules to configure the use of ccache with Cirrus CI jobs,
and preserve the cache across jobs.
The HomeBrew PATH was already present, but incorrect, while
the FreeBSD PATH was missing.
About 1 GB is enough to get a 99% hit rate on a pristine rebuild
with no code changes. Setting it much higher than this will
trigger ENOSPC problems on the FreeBSD builders due to limited
disk size.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
.gitlab-ci.d/cirrus.yml | 3 ++-
.gitlab-ci.d/cirrus/build.yml | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.gitlab-ci.d/cirrus.yml b/.gitlab-ci.d/cirrus.yml
index 2bd3cb35c9..af20082a01 100644
--- a/.gitlab-ci.d/cirrus.yml
+++ b/.gitlab-ci.d/cirrus.yml
@@ -43,6 +43,7 @@ x64-freebsd-14-build:
UPDATE_COMMAND: pkg update; pkg upgrade -y
INSTALL_COMMAND: pkg install -y
CLEAN_COMMAND: pkg clean -y --all
+ PATH_EXTRA: /usr/local/libexec/ccache
CONFIGURE_ARGS:
--target-list-exclude=arm-softmmu,i386-softmmu,microblaze-softmmu,mips64el-softmmu,mipsel-softmmu,mips-softmmu,ppc-softmmu,sh4eb-softmmu,xtensa-softmmu
TEST_TARGETS: check
@@ -56,7 +57,7 @@ aarch64-macos-build:
UPDATE_COMMAND: brew update
INSTALL_COMMAND: brew install
CLEAN_COMMAND: brew cleanup --prune=all
- PATH_EXTRA: /opt/homebrew/ccache/libexec:/opt/homebrew/gettext/bin
+ PATH_EXTRA: /opt/homebrew/opt/ccache/libexec:/opt/homebrew/gettext/bin
PKG_CONFIG_PATH:
/opt/homebrew/curl/lib/pkgconfig:/opt/homebrew/ncurses/lib/pkgconfig:/opt/homebrew/readline/lib/pkgconfig
CONFIGURE_ARGS:
--target-list-exclude=arm-softmmu,i386-softmmu,microblazeel-softmmu,mips64-softmmu,mipsel-softmmu,mips-softmmu,ppc-softmmu,sh4-softmmu,xtensaeb-softmmu
TEST_TARGETS: check-unit check-block check-qapi-schema check-softfloat
check-qtest-x86_64
diff --git a/.gitlab-ci.d/cirrus/build.yml b/.gitlab-ci.d/cirrus/build.yml
index d26a2a788c..5c86278bf8 100644
--- a/.gitlab-ci.d/cirrus/build.yml
+++ b/.gitlab-ci.d/cirrus/build.yml
@@ -5,6 +5,7 @@
env:
CIRRUS_CLONE_DEPTH: 1
+ CCACHE: "@CCACHE@"
CI_REPOSITORY_URL: "@CI_REPOSITORY_URL@"
CI_COMMIT_REF_NAME: "@CI_COMMIT_REF_NAME@"
CI_COMMIT_SHA: "@CI_COMMIT_SHA@"
@@ -27,7 +28,14 @@ build_task:
- git clone --depth 100 "$CI_REPOSITORY_URL" .
- git fetch origin "$CI_COMMIT_REF_NAME"
- git reset --hard "$CI_COMMIT_SHA"
+ obj_cache:
+ folder: ccache
step_script:
+ - export CCACHE_BASEDIR="$(pwd)"
+ - export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
+ - export CCACHE_MAXSIZE="1000M"
+ - ccache --zero-stats
+ - ccache --show-stats
- mkdir build
- cd build
- ../configure --enable-werror $CONFIGURE_ARGS
@@ -38,6 +46,7 @@ build_task:
$MAKE -j$(sysctl -n hw.ncpu) $TARGET V=1 ;
done
- find . -not -path 'meson-logs/*' -delete
+ - ccache --show-stats
always:
build_result_artifacts:
path: build/meson-logs/*log.txt
--
2.46.0
- Re: [PATCH 1/7] gitlab: don't fail cirrus CI jobs when credits are exhausted, (continued)
[PATCH 4/7] gitlab: purge build files from cirrus CI jobs, Daniel P . Berrangé, 2024/12/04
[PATCH 5/7] gitlab: enable ccache with Cirrus CI,
Daniel P . Berrangé <=
[PATCH 6/7] tests: update libvirt-ci submodule for newer ccache, Daniel P . Berrangé, 2024/12/04
[PATCH 7/7] gitlab: force ccache to validate compiler version, Daniel P . Berrangé, 2024/12/04