Use compression and cleanup with the recent version ccache

This commit is contained in:
Mikhail f. Shiryaev 2022-07-30 00:47:12 +02:00
parent eeaf08525f
commit 8533769132
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4
3 changed files with 8 additions and 7 deletions

View File

@ -3,7 +3,7 @@ set -x -e
exec &> >(ts) exec &> >(ts)
cache_status () { ccache_status () {
ccache --show-config ||: ccache --show-config ||:
ccache --show-stats ||: ccache --show-stats ||:
} }
@ -48,7 +48,7 @@ if [ -n "$MAKE_DEB" ]; then
fi fi
cache_status ccache_status
# clear cache stats # clear cache stats
ccache --zero-stats ||: ccache --zero-stats ||:
@ -92,7 +92,7 @@ $SCAN_WRAPPER ninja $NINJA_FLAGS $BUILD_TARGET
ls -la ./programs ls -la ./programs
cache_status ccache_status
if [ -n "$MAKE_DEB" ]; then if [ -n "$MAKE_DEB" ]; then
# No quotes because I want it to expand to nothing if empty. # No quotes because I want it to expand to nothing if empty.
@ -178,7 +178,8 @@ then
mv "coverity-scan.tgz" /output mv "coverity-scan.tgz" /output
fi fi
cache_status ccache_status
ccache --evict-older-than 1d
if [ "${CCACHE_DEBUG:-}" == "1" ] if [ "${CCACHE_DEBUG:-}" == "1" ]
then then

View File

@ -234,6 +234,7 @@ def parse_env_variables(
if cache: if cache:
result.append("CCACHE_DIR=/ccache") result.append("CCACHE_DIR=/ccache")
result.append("CCACHE_COMPRESSLEVEL=5")
result.append("CCACHE_BASEDIR=/build") result.append("CCACHE_BASEDIR=/build")
result.append("CCACHE_NOHASHDIR=true") result.append("CCACHE_NOHASHDIR=true")
result.append("CCACHE_COMPILERCHECK=content") result.append("CCACHE_COMPILERCHECK=content")
@ -242,7 +243,6 @@ def parse_env_variables(
# 15G is not enough for tidy build # 15G is not enough for tidy build
cache_maxsize = "25G" cache_maxsize = "25G"
result.append(f"CCACHE_MAXSIZE={cache_maxsize}") result.append(f"CCACHE_MAXSIZE={cache_maxsize}")
# result.append("CCACHE_UMASK=777")
if distcc_hosts: if distcc_hosts:
hosts_with_params = [f"{host}/24,lzo" for host in distcc_hosts] + [ hosts_with_params = [f"{host}/24,lzo" for host in distcc_hosts] + [

View File

@ -160,9 +160,8 @@ function run_cmake
"-DENABLE_REPLXX=1" "-DENABLE_REPLXX=1"
) )
# TODO remove this? we don't use ccache anyway. An option would be to download it
# from S3 simultaneously with cloning.
export CCACHE_DIR="$FASTTEST_WORKSPACE/ccache" export CCACHE_DIR="$FASTTEST_WORKSPACE/ccache"
export CCACHE_COMPRESSLEVEL=5
export CCACHE_BASEDIR="$FASTTEST_SOURCE" export CCACHE_BASEDIR="$FASTTEST_SOURCE"
export CCACHE_NOHASHDIR=true export CCACHE_NOHASHDIR=true
export CCACHE_COMPILERCHECK=content export CCACHE_COMPILERCHECK=content
@ -191,6 +190,7 @@ function build
gzip "$FASTTEST_OUTPUT/clickhouse-stripped" gzip "$FASTTEST_OUTPUT/clickhouse-stripped"
fi fi
ccache --show-stats ||: ccache --show-stats ||:
ccache --evict-older-than 1d ||:
) )
} }