Skip to contentSkip to conversation

ci: fix ccache for Ubuntu 22.04

PATCH Applied David Marchand 1 participant 2 messages Mar 6, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ci: fix ccache for Ubuntu 22.04

By default (and if no $HOME/.ccache directory exists), Ubuntu 22.04 ccache stores its data in $HOME/.cache/ccache.
As a result, since the switch to Ubuntu 22.04, ccache has not been functional.

Set the ccache directory to the location cached in GHA.

Note: ccache is working with the Fedora containers, as the presence of a .ccache directory made ccache use it, still,
explicitly set CCACHE_DIR for consistency.

Fixes 8400093195dd ("ci: bump tested distributions in GHA")
---
 .github/workflows/build.yml | 2 ++
 1 file changed, 2 insertions(+)
.github/workflows/build.yml +2 -0
index 183b0b1999..a5739a72c6 100644
@@ -45,6 +45,7 @@ jobs:
       BUILD_DOCS: ${{ contains(matrix.config.checks, 'doc') }}
       BUILD_EXAMPLES: ${{ contains(matrix.config.checks, 'examples') }}
       CC: ccache ${{ matrix.config.compiler }}
+      CCACHE_DIR: $HOME/.ccache
       DEF_LIB: ${{ matrix.config.library }}
       LIBABIGAIL_VERSION: libabigail-2.6
       MINGW: ${{ matrix.config.cross == 'mingw' }}
@@ -307,6 +308,7 @@ jobs:
         mkdir -p ~/.ccache
         > ~/env
         echo CC=ccache ${{ matrix.config.compiler }} >> ~/env
+        echo CCACHE_DIR=/root/.ccache >> ~/env
         echo DEF_LIB=${{ matrix.config.library }} >> ~/env
         echo STDATOMIC=false >> ~/env
     - name: Load the cached image
Signature · 1 line
2.48.1
author Applied
#1 lore raw
Quoted 8 lines · David Marchand

By default (and if no $HOME/.ccache directory exists), Ubuntu 22.04 ccache stores its data in $HOME/.cache/ccache.
As a result, since the switch to Ubuntu 22.04, ccache has not been functional.

Set the ccache directory to the location cached in GHA.

Quoted 8 lines

Note: ccache is working with the Fedora containers, as the presence of a .ccache directory made ccache use it, still,
explicitly set CCACHE_DIR for consistency.

Fixes 8400093195dd ("ci: bump tested distributions in GHA")

Applied, thanks.

Signature · 1 line
David Marchand