From e14f97d152f55bf4e3b686d10e064c1e99920336 Mon Sep 17 00:00:00 2001 From: Louis-Philippe Gauthier Date: Mon, 14 Sep 2026 09:36:41 -0400 Subject: [PATCH] Put the CPU model in the bench cache's shared-key rust-cache appends its `key` input only when `shared-key` is unset, so the CPU model added in #54 never reached the cache key: the benchmark job kept restoring `v1-bench-x86_64-unknown-linux-gnu-Linux-x64-...`. A run on an AMD EPYC 7763 restored proc-macro .so files built on an AVX-512 Intel runner and rustc took SIGILL expanding thiserror's derive. Fold the model into shared-key and drop the key input. --- .github/workflows/bench.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index cf71465..af2b0c9 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -41,8 +41,10 @@ jobs: # The instrumented and PGO builds below use target-cpu=native, and # without --target cargo applies RUSTFLAGS to proc macros too. A cached # proc-macro .so compiled on a runner with a wider instruction set makes - # rustc die with SIGILL when it loads it, so the cache is keyed on the - # CPU model as well. + # rustc die with SIGILL when it loads it, so the CPU model is part of the + # cache key. It has to go in `shared-key`, not `key`: rust-cache appends + # `key` only when `shared-key` is unset, so setting both silently drops + # `key` from the cache key. - name: Read runner CPU model id: cpu run: echo "model=$(lscpu | sed -n 's/^Model name:[[:space:]]*//p' | tr -c 'A-Za-z0-9\n' '-')" >> "$GITHUB_OUTPUT" @@ -51,8 +53,7 @@ jobs: uses: Swatinem/rust-cache@v2 with: prefix-key: v1-bench - shared-key: x86_64-unknown-linux-gnu - key: ${{ steps.cpu.outputs.model }} + shared-key: x86_64-unknown-linux-gnu-${{ steps.cpu.outputs.model }} - name: Install dependencies run: mix deps.get