From 1e1ff8a1254c114f261271ffe5580183b8402e32 Mon Sep 17 00:00:00 2001 From: Gangzheng Tong Date: Thu, 4 Sep 2025 19:46:19 -0700 Subject: Fix cache_dir path for ccache config (#8370) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously we are missing `ccache --set-config=cache_dir="$ccache_dir"` and the build was using the default cache_dir. This PR fixed that and the cache are hit in reruns. ``` 📊 ccache statistics (post-build): Cacheable calls: 1198 / 1198 (100.0%) Hits: 1195 / 1198 (99.75%) Direct: 1193 / 1195 (99.83%) Preprocessed: 2 / 1195 ( 0.17%) Misses: 3 / 1198 ( 0.25%) Local storage: Cache size (GiB): 0.6 / 5.0 (11.11%) Hits: 1195 / 1198 (99.75%) Misses: 3 / 1198 ( 0.25%) ``` --- .github/actions/common-setup/action.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to '.github/actions') diff --git a/.github/actions/common-setup/action.yml b/.github/actions/common-setup/action.yml index 1ab2d1a48..5f4bac02c 100644 --- a/.github/actions/common-setup/action.yml +++ b/.github/actions/common-setup/action.yml @@ -150,26 +150,25 @@ runs: echo "✅ ccache found on self-hosted runner - setting up persistent caching" # Set ccache directory to a persistent location outside workspace - # Use runner temp directory with a unique path per repo/compiler/platform - ccache_base_dir="${RUNNER_TEMP:-/tmp}/ccache-slang" + if [[ "${{ inputs.os }}" == "windows" ]]; then + ccache_base_dir="C:/ccache-slang" + else + # Linux/macOS: Use home directory for persistence + ccache_base_dir="$HOME/.ccache-slang" + fi ccache_dir="$ccache_base_dir/${{ inputs.os }}-${{ inputs.compiler }}-${{ inputs.platform }}" mkdir -p "$ccache_dir" echo "CCACHE_DIR=$ccache_dir" >> $GITHUB_ENV echo "🔧 Using persistent ccache directory: $ccache_dir" # Configure ccache settings for local use only - ccache --set-config=max_size=2G + ccache --set-config=max_size=20G ccache --set-config=compression=true ccache --set-config=compression_level=6 ccache --set-config=sloppiness=pch_defines,time_macros + ccache --set-config=cache_dir="$ccache_dir" # Enable ccache for CMake (set environment variables) # Get the full path to ccache executable ccache_path=$(which ccache) echo "ccache_symlinks_path=$ccache_path" >> $GITHUB_ENV - - # Show initial stats - echo "ccache configuration:" - ccache --show-config || echo "Could not show ccache config" - ccache --zero-stats || echo "Could not zero ccache stats" - ccache --show-stats || echo "Could not show ccache stats" -- cgit v1.2.3