Skip to content

Commit 9cc0271

Browse files
committed
ci(windows): force binstall reinstall to restore fresh-install PATH side-effect
First fix attempt (846c596) tried appending GITHUB_PATH from pwsh; ran but didn't make `just` visible to subsequent bash steps. Either the pwsh `Out-File -Encoding utf8` line silently no-op'd, or the appended path-format wasn't honored by the bash shell on Windows. Empirical alternative: just match what the LAST successful Windows run (f13653d / 73003262762) did — a fresh binstall install. Adding --force makes binstall always go through the install path (including whatever PATH side-effect it triggers when fresh-installing on Windows), bypassing the "already installed" branch that cache-restored binaries silently fall into. Cost: ~5s extra per Windows job (4 binaries downloaded + extracted). Worth it to get out of the latent flakiness loop.
1 parent 846c596 commit 9cc0271

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,17 @@ jobs:
6666
run: |
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
69-
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
69+
# WHY --force (added 2026-04-25): without it, when Swatinem
70+
# rust-cache partial-restores `~/.cargo/bin` containing a
71+
# previously-installed just.exe (or its binstall manifest),
72+
# cargo-binstall logs "already installed" and SKIPS the install
73+
# — INCLUDING the bash-PATH side effect that fresh installs
74+
# perform. Subsequent bash steps then fail with
75+
# `just: command not found` even though the binary is on disk.
76+
# --force re-runs the install path unconditionally. Cost:
77+
# ~5s extra per Windows job. Reproduced ci.yml run 24929261378
78+
# + 24929533151 (commits 0889fbb, 846c596).
79+
cargo binstall --no-confirm --locked --force just cargo-deny typos-cli cargo-nextest
8280
8381
- uses: actions/setup-node@v4
8482
with:

0 commit comments

Comments
 (0)