Skip to content

gitlab-ci: disable ccache when building changed aports

clayton craft requested to merge ci_no_ccache into master

Copied from my commit message:

This disables ccache in the CI when building packages. I think ccache is not necessary since the CI will never build a package twice in the same pipeline, and ccache dir is not preserved for use between pipelines. There is a real time cost to compiling with ccache enabled on the initial compile (compressing objects for cache, etc), and some testing with building the linux-purism-librem5 kernel in the CI shows this cost can be significant... ~160 minutes when ccache is enabled vs ~105 minutes when it is disabled with this patch.

kernel compile CI runs referenced:

https://gitlab.com/postmarketOS/pmaports/-/jobs/1087602863

https://gitlab.com/postmarketOS/pmaports/-/jobs/1087956999

Some testing on my laptop using osk-sdl with and without ccache for initial compile:

ccache disabled:

$ rm _build -r && CCACHE_DISABLE=1 meson _build >/dev/null && CCACHE_DISABLE=1 time meson compile -C _build
ninja: Entering directory `_build'
[10/10] Linking target osk-sdl
7.76
$ rm _build -r && CCACHE_DISABLE=1 meson _build >/dev/null && CCACHE_DISABLE=1 time meson compile -C _build
ninja: Entering directory `_build'
[10/10] Linking target osk-sdl
7.89
$ rm _build -r && CCACHE_DISABLE=1 meson _build >/dev/null && CCACHE_DISABLE=1 time meson compile -C _build
ninja: Entering directory `_build'
[10/10] Linking target osk-sdl
7.71

ccache enabled:

$ rm /tmp/ccache _build -r && CCACHE_DIR=/tmp/ccache meson _build >/dev/null&& CCACHE_DIR=/tmp/ccache time meson compile -C _build
ninja: Entering directory `_build'
[10/10] Linking target osk-sdl
8.62
$ rm /tmp/ccache _build -r && CCACHE_DIR=/tmp/ccache meson _build >/dev/null&& CCACHE_DIR=/tmp/ccache time meson compile -C _build
ninja: Entering directory `_build'
[10/10] Linking target osk-sdl
8.46
$ rm /tmp/ccache _build -r && CCACHE_DIR=/tmp/ccache meson _build >/dev/null&& CCACHE_DIR=/tmp/ccache time meson compile -C _build
ninja: Entering directory `_build'
[10/10] Linking target osk-sdl
8.54
Edited by clayton craft

Merge request reports