Skip to content

Commit 74a83a1

Browse files
committed
Cleanup CCache on startup
Avoid cache being too large when restored.
1 parent da472c7 commit 74a83a1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ci/setup_ccache.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ ccache --version
3939

4040
# This also sets the default values
4141
echo "Using cache directory of size ${B2_CCACHE_SIZE:=500M} at '${B2_CCACHE_DIR:=$HOME/.ccache}'"
42-
4342
ccache --set-config=cache_dir="$B2_CCACHE_DIR"
4443
ccache --set-config=max_size="$B2_CCACHE_SIZE"
44+
ccache --cleanup
45+
if curSize=$(du -sh "$B2_CCACHE_DIR" 2>/dev/null | cut -f1); then
46+
echo "Current cache size: $curSize"
47+
fi
4548

4649
ccache -z
4750
echo "CCache config: $(ccache -p)"

0 commit comments

Comments
 (0)