Skip to content

About ccache and cache storage #1023

@mwestphal

Description

@mwestphal

Hi TTK!

I see that your CI is starting to use ccache, that's great!
However, I see that you started using release to store the caches themselves, I dont think this is the easiest nor the most efficient way to it.

Also, ccache is linux specific, while sccache supports all OSes.

Over at F3D we are using sccache and cache github actions to handle our cache with success and great compilation speedup.

It is done like this:


  - name: Initialize sccache environnement
    shell: bash
    run: |
      sccache --start-server
      echo SCCACHE_CACHE=$(sccache --show-stats | grep Local | cut -d '"' -f2) >> $GITHUB_ENV
      echo DATE_STRING=$(date +'%Y%m%d') >> $GITHUB_ENV
      sccache --stop-server

  - name: Recover sccache cache
    uses: actions/cache@v4
    with:
      path: ${{env.SCCACHE_CACHE}}
      key: sccache-cache-${{inputs.raytracing_label}}-${{runner.os}}-${{ runner.os == 'macOS' && env.CMAKE_OSX_ARCHITECTURES || 'x86_64' }}-0-${{env.DATE_STRING}}
      restore-keys: sccache-cache-${{inputs.raytracing_label}}-${{runner.os}}-${{ runner.os == 'macOS' && env.CMAKE_OSX_ARCHITECTURES || 'x86_64' }}-0

  - name: Start sccache
    shell: bash
    working-directory: ${{github.workspace}}
    run: sccache --start-server

Full CI is here: https://github.com/f3d-app/f3d-superbuild/blob/main/.github/actions/f3d-superbuild/action.yml#L46

I dont have enough bandwidth to take care of this myself but I'd be happy to explain how it works and why I think this would provide better feature than the solution currently being implemented :)

hth

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions