mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user