From 6c7956ab933676059c3784bb346a40c2a07308ed Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Wed, 25 Oct 2023 10:54:02 +0300 Subject: [PATCH] ci: Autodetect if cacche is available to print the stats Always print the stats if ccache executable exists, this way we can get rid of one extra env var. Part-of: --- .gitlab-ci.yml | 2 -- ci/scripts/build.sh | 14 +++++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0235886b2d..ff92c4a287 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -252,7 +252,6 @@ commitlint: .build_ccache_vars: variables: - HAVE_CCACHE: 'true' CCACHE_COMPILERCHECK: 'content' CCACHE_COMPRESS: 'true' CCACHE_BASEDIR: '/cache/gstreamer/gstreamer' @@ -518,7 +517,6 @@ build macos: - '.macos image' variables: # gst-libav/ffmpeg throws Wundef errors - HAVE_CCACHE: 'false' GST_WERROR: "false" MESON_ARGS: "${DEFAULT_MESON_ARGS}" SUBPROJECTS_CACHE_DIR: "/Users/gst-ci/subprojects" diff --git a/ci/scripts/build.sh b/ci/scripts/build.sh index c57af28abe..8d4864494d 100755 --- a/ci/scripts/build.sh +++ b/ci/scripts/build.sh @@ -10,8 +10,6 @@ set -eux # GST_WERROR: make warning fatal or not # must be a string of a boolean, "true" or "false". Not yaml bool. # SUBPROJECTS_CACHE_DIR: The location in the image of the subprojects cache -# HAVE_CCACHE: whether we have ccache available -# must be a string of a boolean, "true" or "false". Not yaml bool. export RUSTUP_HOME="/usr/local/rustup" export CARGO_HOME="/usr/local/cargo" @@ -29,8 +27,18 @@ fi date -R meson setup build/ --native-file ./ci/meson/gst-ci-cflags.ini ${ARGS} +date -R + +if command -v ccache +then + ccache --show-stats +fi + date -R meson compile -C build/ date -R -test "$HAVE_CCACHE" = "true" && ccache --show-stats +if command -v ccache +then + ccache --show-stats +fi