From eafedae246fc0672ef255b08f50306f20ac21a02 Mon Sep 17 00:00:00 2001 From: zackees Date: Sun, 28 Jun 2026 10:10:14 -0700 Subject: [PATCH] fix(ci): force-reinstall rust-std for target (win-arm64 E0463 fix) soldr#1006 Lane 2 third attempt. v2.3.9 win-arm64 failed at: error[E0463]: can't find crate for `core` note: the `aarch64-pc-windows-msvc` target may not be installed `rustup target add` had already reported "info: component rust-std for target aarch64-pc-windows-msvc is up to date". The mismatch is setup-soldr's thin-mode build cache: it trims the actual rust-std .rlib files from the toolchain dir while leaving rustup's component manifest claiming the target is installed. Subsequent `rustup target add` then short-circuits and rustc fails at compile. Fix: remove + add. `rustup target remove` clears the manifest entry so the immediate `rustup target add` reinstalls the files for real. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/template_native_build.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/template_native_build.yml b/.github/workflows/template_native_build.yml index 98fcd151..dcbc9c5a 100644 --- a/.github/workflows/template_native_build.yml +++ b/.github/workflows/template_native_build.yml @@ -105,9 +105,23 @@ jobs: python-version: "3.13" # rust-toolchain.toml pins 1.94.1 which overrides the above; - # ensure the target stdlib is installed for the pinned toolchain too + # ensure the target stdlib is installed for the pinned toolchain too. + # + # The remove + add dance is required for aarch64-pc-windows-msvc + # (and a known-good safety belt for other targets): setup-soldr's + # thin-mode build cache can leave rustup's component-manifest + # claiming a target is installed while the actual rust-std .rlib + # files have been trimmed from the toolchain dir. `rustup target + # add` would then say "is up to date" and skip the install, and + # rustc would later fail with `E0463: can't find crate for 'core'` + # / `the target may not be installed`. Forcing the remove + # first wipes the manifest entry so the subsequent add reinstalls + # the files for real. `|| true` because remove on an already- + # missing target exits non-zero. - name: Add Rust target - run: rustup target add ${{ inputs.target }} + run: | + rustup target remove ${{ inputs.target }} || true + rustup target add ${{ inputs.target }} # Linux musl toolchain (libudev is auto-excluded for musl targets by serialport) - name: Install Linux dependencies