Skip to content

[CI][C++] Improve ccache performance by using more general cache keys #50046

Description

@rok

Describe the enhancement requested

Our C++ GitHub Actions jobs currently use ccache through actions/cache. Many cache keys include the full C++ source tree hash, for example:

key: cpp-ccache-macos-${{ matrix.macos-version }}-${{ hashFiles('cpp/**') }}
restore-keys: cpp-ccache-macos-${{ matrix.macos-version }}-

This was originally introduced in #7081 as a workaround for GitHub Actions cache immutability: cache entries cannot be updated once written, so changing keys are needed to create new cache snapshots.

However, using hashFiles('cpp/**') might be suboptimal for compiler caches. Hashing the entire source tree at the outer GitHub cache layer creates many distinct cache entries and increases the chance of cache misses/eviction.

Component(s)

Continuous Integration

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions