From 17720fa870e8034f3c2e5eaed606ec58797cb1b9 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Wed, 10 Mar 2021 01:08:22 -0800 Subject: [PATCH] gitlab-ci: disable ccache when building changed aports (MR 2020) 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 --- .gitlab-ci/build_changed_aports.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci/build_changed_aports.py b/.gitlab-ci/build_changed_aports.py index c48323c55..d19e02131 100755 --- a/.gitlab-ci/build_changed_aports.py +++ b/.gitlab-ci/build_changed_aports.py @@ -15,8 +15,9 @@ import pmb.helpers.pmaports def build_strict(packages, arch): common.run_pmbootstrap(["build_init"]) - common.run_pmbootstrap(["--details-to-stdout", "build", "--strict", - "--force", "--arch", arch] + list(packages)) + common.run_pmbootstrap(["--details-to-stdout", "--no-ccache", "build", + "--strict", "--force", + "--arch", arch, ] + list(packages)) def verify_checksums(packages, arch):