From a3e06251d2c82534474805a4cd68661f96eb97b8 Mon Sep 17 00:00:00 2001 From: althafvly Date: Tue, 3 Feb 2026 11:48:19 +0530 Subject: [PATCH] Update ccache config for latest --- build.sh | 16 ++++------------ build_subresource_filter_tools.sh | 15 +++------------ init-ccache.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 24 deletions(-) create mode 100755 init-ccache.sh diff --git a/build.sh b/build.sh index 9ec78387..d808fd3f 100755 --- a/build.sh +++ b/build.sh @@ -94,17 +94,6 @@ build() { fi } -setup_ccache() { - echo ">> [$(date)] Settings up ccache" - export USE_CCACHE=1 - export CCACHE_EXEC=$(command -v ccache) - export PATH=$chromium_dir/src/third_party/llvm-build/Release+Asserts/bin:$PATH - export CCACHE_CPP2=yes - export CCACHE_SLOPPINESS=time_macros - export CCACHE_DIR=$chromium_dir/.ccache - ccache -M 200G -} - patch() { cd $chromium_dir/src echo ">> [$(date)] Applying cromite patches" @@ -270,6 +259,8 @@ else fi export PATH="$chromium_dir/depot_tools:$PATH" +source ${root_dir}/init-ccache.sh + chromium_commit_hash=$(git ls-remote --refs $chromium_url refs/tags/$chromium_version | awk '{print $1}') if [ $clean -eq 1 ]; then @@ -311,7 +302,6 @@ fi cd $chromium_dir/src . build/android/envsetup.sh -setup_ccache if [ ! -z "$arch" ]; then build $arch @@ -321,3 +311,5 @@ else build x86 build x64 fi + +ccache -s diff --git a/build_subresource_filter_tools.sh b/build_subresource_filter_tools.sh index 19dda170..985456e7 100755 --- a/build_subresource_filter_tools.sh +++ b/build_subresource_filter_tools.sh @@ -20,20 +20,11 @@ build() { fi } -setup_ccache() { - echo ">> [$(date)] Settings up ccache" - export USE_CCACHE=1 - export CCACHE_EXEC=$(command -v ccache) - export PATH=$chromium_dir/src/third_party/llvm-build/Release+Asserts/bin:$PATH - export CCACHE_CPP2=yes - export CCACHE_SLOPPINESS=time_macros - export CCACHE_DIR=$chromium_dir/.ccache - ccache -M 200G -} - export PATH="$chromium_dir/depot_tools:$PATH" +source ${root_dir}/init-ccache.sh + cd $chromium_dir/src . build/android/envsetup.sh -setup_ccache build +ccache -s diff --git a/init-ccache.sh b/init-ccache.sh new file mode 100755 index 00000000..28224fc8 --- /dev/null +++ b/init-ccache.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +chromium_dir="${CHROMIUM_DIR}" +root_dir=$(dirname "$(readlink -f "$0")") +if [ ! -d "$chromium_dir" ]; then + chromium_dir=$root_dir +fi + +echo ">> [$(date)] Setting up ccache config" +export PATH=$chromium_dir/src/third_party/llvm-build/Release+Asserts/bin:$PATH +export CCACHE_DIR=$chromium_dir/.ccache +export USE_CCACHE=1 + +echo ">> [$(date)] Applying ccache configuration" +ccache --set-config=max_size=200G \ + --set-config=compression_level=6 \ + --set-config=sloppiness=time_macros + +echo ">> [$(date)] Cleaning unused cache files and statistics" +ccache --evict-older-than 30d +ccache -c +ccache -z + +echo ">> [$(date)] Recompressing existing cache entries" +ccache --recompress 6 + +export PATH="/usr/lib/ccache:$PATH" -- GitLab