From 12597308dea190cce98d9c404ddf8b3985c7fdc2 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Thu, 11 Jun 2026 23:06:59 +0000 Subject: [PATCH] smoke-test, os-check: pin CCACHE_DIR to the cached path The two jobs that manage their ccache cache manually rely on ccache's XDG default (~/.cache/ccache) matching the actions/cache path. That holds today, but nothing enforces it: a later change that sets CCACHE_DIR (e.g. adopting the ccache-setup composite, which uses ~/.ccache) would silently decouple the build's cache from the saved/restored directory. Pin CCACHE_DIR explicitly to the cached path so the pairing is visible and cannot drift. --- .github/workflows/os-check.yml | 6 ++++++ .github/workflows/smoke-test.yml | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/os-check.yml b/.github/workflows/os-check.yml index 10aa21d26b..5efd8954d0 100644 --- a/.github/workflows/os-check.yml +++ b/.github/workflows/os-check.yml @@ -75,6 +75,12 @@ jobs: - name: Allow unprivileged user namespaces (for bwrap) run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true + # ccache's default cache dir (XDG ~/.cache/ccache) is what the + # actions/cache step below saves; pin it explicitly so the two + # cannot drift apart (e.g. if a later change sets CCACHE_DIR). + - name: Pin ccache directory + run: echo "CCACHE_DIR=$HOME/.cache/ccache" >> "$GITHUB_ENV" + - name: Restore ccache uses: actions/cache@v4 with: diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 3ab7bf6ab5..ec3c764f99 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -98,6 +98,13 @@ jobs: if: steps.merge_check.outputs.skip != 'true' run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true + # ccache's default cache dir (XDG ~/.cache/ccache) is what the + # actions/cache step below saves; pin it explicitly so the two + # cannot drift apart (e.g. if a later change sets CCACHE_DIR). + - name: Pin ccache directory + if: steps.merge_check.outputs.skip != 'true' + run: echo "CCACHE_DIR=$HOME/.cache/ccache" >> "$GITHUB_ENV" + - name: Restore ccache if: steps.merge_check.outputs.skip != 'true' uses: actions/cache@v4