From efd8ec0fb454d276716248b788676aec69d49dac Mon Sep 17 00:00:00 2001 From: denis0001-dev Date: Tue, 20 Oct 2026 02:39:30 +0300 Subject: [PATCH] ci(windows): align rust cache save key with restore key (arch + v5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The save action wrote windows-rust-Windows-v3- with no arch while restore fanned out on windows-rust-Windows--v4- — so every saved entry was unreachable by design. It also made the two matrix legs race to reserve the same key: ARM won, x64 got 'another job may be creating this cache'. Save now uses the exact restore key (arch + v5); restore falls back only to same-arch v5 prefixes to avoid pulling the stale archless v3 entries into the wrong build. --- .github/actions/cache-windows-rust-tools/action.yml | 5 ++--- .github/actions/save-windows-rust-cache/action.yml | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/actions/cache-windows-rust-tools/action.yml b/.github/actions/cache-windows-rust-tools/action.yml index 5a18bb0..951545d 100644 --- a/.github/actions/cache-windows-rust-tools/action.yml +++ b/.github/actions/cache-windows-rust-tools/action.yml @@ -16,8 +16,7 @@ runs: ~/.cargo/registry ~/.cargo/git app/desktop/windows-setup/target - key: windows-rust-${{ runner.os }}-${{ runner.arch }}-v4-${{ hashFiles('app/desktop/windows-setup/Cargo.lock') }} + key: windows-rust-${{ runner.os }}-${{ runner.arch }}-v5-${{ hashFiles('app/desktop/windows-setup/Cargo.lock') }} restore-keys: | - windows-rust-${{ runner.os }}-${{ runner.arch }}-v4- - windows-rust-${{ runner.os }}-${{ runner.arch }}-v3- + windows-rust-${{ runner.os }}-${{ runner.arch }}-v5- cargo-registry-${{ runner.os }}- diff --git a/.github/actions/save-windows-rust-cache/action.yml b/.github/actions/save-windows-rust-cache/action.yml index 8ff50e2..09f17ce 100644 --- a/.github/actions/save-windows-rust-cache/action.yml +++ b/.github/actions/save-windows-rust-cache/action.yml @@ -4,10 +4,15 @@ description: Save Cargo registry, git checkouts, and the windows-setup target di runs: using: composite steps: + # The save key MUST match cache-windows-rust-tools' exact restore key byte for byte: it has to + # carry runner.arch — the two matrix legs race to save the same key otherwise (actions/cache + # rejects the second with "another job may be creating this cache"), and a saved entry without + # the arch can never be restored because no restore key matches its shape. v3 was an archless + # relic: every entry it ever wrote was dead on arrival. - uses: actions/cache/save@v5 continue-on-error: true with: - key: windows-rust-${{ runner.os }}-v3-${{ hashFiles('app/desktop/windows-setup/Cargo.lock') }} + key: windows-rust-${{ runner.os }}-${{ runner.arch }}-v5-${{ hashFiles('app/desktop/windows-setup/Cargo.lock') }} path: | ~/.cargo/registry ~/.cargo/git