fix: don't override ccache's default cache_dir

PROBLEM: Setting cache_dir='~/.ccache' explicitly stores the
LITERAL tilde in ccache.conf, which might not expand properly.

SOLUTION: Don't set cache_dir at all - let ccache use its default
- Linux default: ~/.ccache
- ccache will expand the tilde correctly when using default
- Only configure max_size, hash_dir, compiler_check
- Remove CCACHE_DIR env var (not needed with default)

This should fix the issue where ccache runs but creates no cache files.
This commit is contained in:
Nicholas Dudfield
2025-10-30 17:58:08 +07:00
parent d0f63cc2d1
commit a4f96a435a

View File

@@ -25,17 +25,18 @@ runs:
- name: Configure ccache
shell: bash
run: |
# Create cache directory
mkdir -p ${{ inputs.cache_dir }}
# Use ccache's default cache_dir (~/.ccache) - don't override it
# This avoids tilde expansion issues when setting it explicitly
# Configure ccache settings
ccache --set-config=cache_dir="${{ inputs.cache_dir }}"
# Create cache directory using ccache's default
mkdir -p ~/.ccache
# Configure ccache settings (but NOT cache_dir - use default)
ccache --set-config=max_size=${{ inputs.max_size }}
ccache --set-config=hash_dir=${{ inputs.hash_dir }}
ccache --set-config=compiler_check=${{ inputs.compiler_check }}
# Export for use by build tools
echo "CCACHE_DIR=${{ inputs.cache_dir }}" >> $GITHUB_ENV
# Note: Not setting CCACHE_DIR - let ccache use its default (~/.ccache)
# Print config for verification
ccache -p