]> git.ipfire.org Git - thirdparty/libvirt.git/commit
gitlab: Enable improved ccache usage
authorAndrea Bolognani <abologna@redhat.com>
Mon, 30 Mar 2020 16:29:06 +0000 (18:29 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 15 Apr 2020 15:50:49 +0000 (17:50 +0200)
commita158eb5c8e18336d1dd39148a5d5c6b0bd3f26c1
tree4422ab051bc4daf1b2e676601a7860320e47f634
parent29e09694bcc4f54f97702e1a80913a97110c54a8
gitlab: Enable improved ccache usage

Setting CC="ccache cc" works in most cases, but sometimes it will
break the build: in particular, we have experienced issues in the
past with that approach when using cgo to build our Go bindings.

A more robust approach is to have a directory containing symlinks
from the compiler name to the ccache binary: in that case, ccache
itself will invoke the compiler, and the build system will be none
the wiser.

Since libvirt-ci commit 2563aebb6c5c, container images contain a
suitable symlink directory, so all that's needed to enable the new
approach is to add this directory to $PATH.

Since we're touching this anyway, we make a few more changes:
$CCACHE_DIR is no longer created manually, because ccache will
take care of creating it for us if it doesn't already exist; the
ccache setup is moved out of the job template and into
script_variables, removing unnecessary duplication; a limit is
set on the size of the cache (500 MB, which is twice the amount
used by a fresh build on my Fedora 31 machine).

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
.gitlab-ci.yml