Skip to content

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

Closed

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

  1. changed the title [-][CI][C++] Improve GitHub Actions ccache reuse by saving compiler caches only from main[/-] [+][CI][C++] Improve ccache reuse by saving to cache only from main[/+] on May 26, 2026
  2. changed the title [-][CI][C++] Improve ccache reuse by saving to cache only from main[/-] [+][CI][C++] Improve ccache performance by using more general cache keys[/+] on Jun 2, 2026
  3. added a commit that references this issue on Jun 5, 2026
  4. added this to the 25.0.0 milestone on Jun 5, 2026
  5. kou commented on Jun 5, 2026

    @kou
    Member

    Issue resolved by pull request 50047
    #50047

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