From 2bf2d2891a5aea93dacf8a3fcb995cbc848b7a00 Mon Sep 17 00:00:00 2001 From: Carlos Medeiros Date: Mon, 22 Jun 2026 15:14:11 +0100 Subject: [PATCH] fix(ledger): also re-checkout cargo config in clippy/rust_tests jobs The clippy and rust_tests jobs cache ./app/rust/.cargo (which includes the tracked config.toml) too. A pre-migration cache restores an old config.toml with build-std over the checkout; once the host toolchain is nightly that build-std rebuilds host core -> E0152 duplicate lang item. Apply the same re-checkout of the committed config.toml after the cache restore in these two jobs (build_ledger/build_package already do this). --- .github/workflows/_ledger_main.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/_ledger_main.yml b/.github/workflows/_ledger_main.yml index b7e6001..4ad2f0a 100644 --- a/.github/workflows/_ledger_main.yml +++ b/.github/workflows/_ledger_main.yml @@ -158,6 +158,13 @@ jobs: restore-keys: | ${{ runner.os }}-cargo-${{ runner.arch }}- ${{ runner.os }}-cargo- + - name: Restore tracked cargo config (cache may carry a pre-migration copy) + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + if git -C "$GITHUB_WORKSPACE" ls-files --error-unmatch app/rust/.cargo/config.toml >/dev/null 2>&1; then + git -C "$GITHUB_WORKSPACE" checkout -- app/rust/.cargo/config.toml + echo "Restored app/rust/.cargo/config.toml from checkout (a stale Rust cache can overwrite it with a pre-migration copy)." + fi - name: clippy run: | cd ./app/rust @@ -182,6 +189,13 @@ jobs: restore-keys: | ${{ runner.os }}-cargo-${{ runner.arch }}- ${{ runner.os }}-cargo- + - name: Restore tracked cargo config (cache may carry a pre-migration copy) + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + if git -C "$GITHUB_WORKSPACE" ls-files --error-unmatch app/rust/.cargo/config.toml >/dev/null 2>&1; then + git -C "$GITHUB_WORKSPACE" checkout -- app/rust/.cargo/config.toml + echo "Restored app/rust/.cargo/config.toml from checkout (a stale Rust cache can overwrite it with a pre-migration copy)." + fi - name: run rust tests run: | cd ./app/rust