From 8702a6af537154bf10a38a874c0e93eed0fb5f32 Mon Sep 17 00:00:00 2001 From: Dave Wallace Date: Tue, 6 Apr 2021 20:41:43 -0400 Subject: Refactor ccache config to use per-os ccache dirs. - Simplify ccache state output to console log by using ccache stats command. - Bump max size of ccache dir to 10G (centos8 is approximately 5.7G) - Clean up extraneous ccache dir after docker build is complete. Change-Id: Ia2b55b7cd47212fce91b4567d0cca69d2ce892ed Signed-off-by: Dave Wallace --- jjb/scripts/setup_executor_env.sh | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'jjb') diff --git a/jjb/scripts/setup_executor_env.sh b/jjb/scripts/setup_executor_env.sh index f9aecfa40..a6b8216d6 100755 --- a/jjb/scripts/setup_executor_env.sh +++ b/jjb/scripts/setup_executor_env.sh @@ -61,25 +61,19 @@ echo "$long_line" echo "DNS nameserver config in '/etc/resolv.conf':" cat /etc/resolv.conf || true -if [ -n "${CCACHE_DIR:-}" ] ; then - echo "$long_line" - if [ -d "$CCACHE_DIR" ] ; then - num_ccache_files="$(find $CCACHE_DIR -type f | wc -l)" - ccache_conf="$CCACHE_DIR/ccache.conf" - echo "CCACHE_DIR='$CCACHE_DIR' ($num_ccache_files ccache files):" - du -sh /tmp/ccache - df -h /tmp/ccache - ls -l $CCACHE_DIR - unset -v CCACHE_DISABLE - if [ -f "$ccache_conf" ] ; then - echo "Contents of $ccache_conf:" - cat $ccache_conf - fi - else +echo "$long_line" +if [ -n "$(which ccache || true)" ] ; then + if [ -z "${CCACHE_DIR:-}" ] || [ ! -d "$CCACHE_DIR" ] ; then echo "CCACHE_DIR='$CCACHE_DIR' is missing, disabling CCACHE..." - unset -v CCACHE_DIR export CCACHE_DISABLE="1" - echo "CCACHE_DISABLE='${CCACHE_DISABLE:-}'" fi + if [ -n "${CCACHE_DISABLE:-}" ] ; then + echo "CCACHE_DISABLE = '$CCACHE_DISABLE'" + fi + echo "ccache statistics:" + ccache -s +else + echo "WARNING: ccache is not installed!" + export CCACHE_DISABLE="1" fi echo "$long_line" -- cgit 1.2.3-korg