Skip to content

Commit 846c596

Browse files
committed
ci(windows): force ~/.cargo/bin onto GITHUB_PATH after binstall
Windows ci.yml run 24929261378 (commit 0889fbb) failed at `Run just ci` with `just: command not found` despite cargo-binstall logging "v1.50.0 is already installed". Root cause: the rustup-init step's `echo $CARGO_HOME\bin >> $GITHUB_PATH` line is gated behind `command -v rustup`, which always succeeds on windows-latest (rustup pre-installed). When Swatinem rust-cache partial-restores ~/.cargo/bin containing a previously-installed just.exe, binstall skips install AND its PATH side-effect — leaving bash steps unable to find just.exe even though it's on disk. Forcing $env:GITHUB_PATH after binstall is unconditional and idempotent. Reverts to the prior latent-flakiness state if the upstream rustup-init gate is fixed. Independent of the fuzz/bench fixes in 0889fbb — that commit only modified fuzz.yml + 2 Cargo.toml files; the Windows breakage was a pre-existing race that finally hit on this push's cache-state shuffle.
1 parent 0889fbb commit 846c596

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ jobs:
6767
Invoke-WebRequest -Uri "https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip" -OutFile binstall.zip
6868
Expand-Archive binstall.zip -DestinationPath "$env:USERPROFILE\.cargo\bin" -Force
6969
cargo binstall --no-confirm --locked just cargo-deny typos-cli cargo-nextest
70+
# WHY explicit GITHUB_PATH update (added 2026-04-25): when
71+
# Swatinem rust-cache partial-restores `~/.cargo/bin` containing
72+
# a previously-installed just.exe, cargo-binstall logs "already
73+
# installed" and SKIPS — including the side-effect PATH inject
74+
# that fresh installs perform. Meanwhile rustup-init's
75+
# `echo $CARGO_HOME\bin >> $GITHUB_PATH` is gated behind
76+
# `command -v rustup`, which always succeeds on windows-latest
77+
# (rustup is pre-installed). Net effect: bash steps that run
78+
# `just ci` later can't see just.exe on PATH even though it's on
79+
# disk. Forcing the GITHUB_PATH update here is unconditional and
80+
# idempotent. Reproduced on ci.yml run 24929261378 (0889fbb).
81+
"$env:USERPROFILE\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
7082
7183
- uses: actions/setup-node@v4
7284
with:

0 commit comments

Comments
 (0)