fix(release): resolve Windows Bash via PATH - #39
Merged
Merged
Conversation
kalvinnchau
pushed a commit
that referenced
this pull request
Sep 16, 2026
…bs (#328) ## Summary `Get-GitBashPath` tried two `Program Files\Git` literals and then returned whatever `bash` resolved to on PATH. On a stock Windows 11 machine that is the Microsoft Store app-execution alias (`%LOCALAPPDATA%\Microsoft\WindowsApps\bash.exe`) or the WSL launcher (`System32\bash.exe`); both precede Git for Windows on PATH and neither can run repository scripts. Per-user Git installs (winget user scope, `%LOCALAPPDATA%\Programs\Git`) were never considered. #39 (`c174a7d0`) fixed the same confusion on the `just` side by pinning just 1.48.0 but left this diagnostic helper alone, so `bootstrap-windows` and `doctor-windows` kept reporting the stub as a healthy Git Bash. Changes, modelled on `Find-RunnablePython`: - `Get-GitBashPath` gathers candidates from the machine-wide and per-user install roots, from the root of the `git.exe` on PATH (`<root>\bin\bash.exe`, `<root>\usr\bin\bash.exe`), and from every `where.exe bash` hit, then filters them through a new pure helper `Test-GitBashCandidatePath` (rejects `\WindowsApps\`, `System32`/`SysWOW64` `bash.exe`, Codex runtimes). It returns `$null` when nothing usable exists. - `Bootstrap-Windows.ps1` and `Doctor-Windows.ps1` failure text no longer claims Git lives under `Program Files\Git` and names the stubs that do not count. - `Test-WindowsDev.ps1` covers the filter (WSL launcher, 32-bit launcher, Store alias, Codex runtime, blank, machine-wide, per-user), checks the lookup applies the filter and derives from `git.exe`, and validates the live result on the machine running the tests. Why now: an internal Windows build lane resolved `bash.exe` to the WSL stub and had to carry its own lookup; this makes the module's helper trustworthy so callers can rely on it. ### Related issue Follows up on #39; none open. ### Testing - `just test-windows-dev` under PowerShell 7 on Windows 11: all new assertions pass. (Under Windows PowerShell 5.1 the suite still trips on the pre-existing `[semver]` use at lines 162-165, which #329 fixes; this branch inherits that fix from `main` once it merges.) - With `%LOCALAPPDATA%\Microsoft\WindowsApps` moved to the front of PATH (so `where.exe bash` lists the Store alias first), `Get-GitBashPath` returns `C:\Program Files\Git\bin\bash.exe` under both hosts; `Get-WindowsPrerequisiteSnapshot` reports `GitBash.Found = True` with that path. - Parser check of the four touched scripts: no parse errors. --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just 1.40.0 resolves the Windows
[script("bash", ...)]interpreter toC:\Windows\System32\bash.exe, the WSL launcher, instead of the Git Bash executable earlier onPATH. This is the command-resolution bug tracked in casey/just#2947 and fixed by casey/just#3160. Just 1.48.0 is the first release containing that fix.This updates the Hermit package and GitHub Actions pins to Just 1.48.0. It also removes
JUST_UNSTABLE; the script recipe attribute used byrelease-write-provenanceis stable in this version.With Git Bash selected,
write-provenance.shmust usesha256sumrather than assuming macOS'sshasumis installed. The script now selectsshasum -a 256when available, falls back tosha256sum, and exits with an explicit error when neither tool exists.Validated with:
just release-scripts-test(83 tests)just checkjust fmt-checkjust tauri-checkjust clippybin/hermit validate env .