diff options
| author | Gangzheng Tong <tonggangzheng@gmail.com> | 2025-09-04 19:46:19 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-04 19:46:19 -0700 |
| commit | 1e1ff8a1254c114f261271ffe5580183b8402e32 (patch) | |
| tree | 177ccb89a90f31d5e6eab0a72c8a4788b5cbcdf3 /.github/actions | |
| parent | 0fb62524bc8beda70694f6c58570ad8096bbe698 (diff) | |
Fix cache_dir path for ccache config (#8370)
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%)
```
Diffstat (limited to '.github/actions')
| -rw-r--r-- | .github/actions/common-setup/action.yml | 17 |
1 files changed, 8 insertions, 9 deletions
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" |
