From d703455ef208f7ed9f878cd4a8ccb9e8a6ef261f Mon Sep 17 00:00:00 2001 From: jwinterm Date: Sat, 19 Sep 2026 12:07:18 -0400 Subject: [PATCH] ci(windows): export the Rust env for the step that checks it The detection branch found the toolchain, wrote RUSTUP_HOME and CARGO_HOME to $GITHUB_ENV, and then verified with `rustc --version` in the same step. $GITHUB_ENV only reaches later steps, so that verification ran with neither variable set and the rustup shim fell back to %USERPROFILE%\.rustup. On this runner that path is a file, so it failed with os error 183 while a perfectly good toolchain sat at C:\Rust. The step's own comment already explained why the shims need RUSTUP_HOME. It just never exported it for its own use. The install branch does export before its check, which is why only the detection path broke, and why it broke on a runner that already had Rust rather than on a fresh one. No app code changes, so hash-bags-ios-1.0.3 stays where it is: Android, Linux and iOS are building from that commit and the artifacts are unaffected. --- .github/workflows/build-windows.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 75b1faf28..a52b5a317 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -101,8 +101,17 @@ jobs: # LocalSystem service account. if [[ -d "$(dirname "$(dirname "$d")")/rustup" ]]; then RUSTUP_DIR="$(dirname "$(dirname "$d")")/rustup" - echo "RUSTUP_HOME=$(cygpath -w "$RUSTUP_DIR")" >> "$GITHUB_ENV" - echo "CARGO_HOME=$(cygpath -w "$(dirname "$d")")" >> "$GITHUB_ENV" + # Export for THIS step as well as writing to $GITHUB_ENV. + # $GITHUB_ENV only reaches later steps, and the verification on + # the next line is itself a rustup shim: without the export it + # falls back to %USERPROFILE%\.rustup, which on this runner is + # a file rather than a directory, so it fails with os error 183 + # having ignored the toolchain we just found. + RUSTUP_HOME="$(cygpath -w "$RUSTUP_DIR")" + CARGO_HOME="$(cygpath -w "$(dirname "$d")")" + export RUSTUP_HOME CARGO_HOME + echo "RUSTUP_HOME=$RUSTUP_HOME" >> "$GITHUB_ENV" + echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" fi rustc --version exit 0