ci: fix ccache for Ubuntu 22.04

Message ID 20250306143443.3972030-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series ci: fix ccache for Ubuntu 22.04 |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-marvell-Functional success Functional Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

David Marchand March 6, 2025, 2:34 p.m. UTC
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")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 .github/workflows/build.yml | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

David Marchand March 6, 2025, 5:09 p.m. UTC | #1
On Thu, Mar 6, 2025 at 3:34 PM David Marchand <david.marchand@redhat.com> wrote:
>
> 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")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.
  

Patch

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 183b0b1999..a5739a72c6 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -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