Skip to content

fix(release): resolve Windows Bash via PATH - #39

Merged
kalvinnchau merged 3 commits into
mainfrom
fix/windows-just-bash-resolution
Aug 14, 2026
Merged

kalvinnchau merged 3 commits into
mainfrom
fix/windows-just-bash-resolution

Conversation

@kalvinnchau

@kalvinnchau kalvinnchau commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Just 1.40.0 resolves the Windows [script("bash", ...)] interpreter to C:\Windows\System32\bash.exe, the WSL launcher, instead of the Git Bash executable earlier on PATH. 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 by release-write-provenance is stable in this version.

With Git Bash selected, write-provenance.sh must use sha256sum rather than assuming macOS's shasum is installed. The script now selects shasum -a 256 when available, falls back to sha256sum, and exits with an explicit error when neither tool exists.

Validated with:

  • just release-scripts-test (83 tests)
  • just check
  • just fmt-check
  • just tauri-check
  • just clippy
  • bin/hermit validate env .

@kalvinnchau
kalvinnchau requested a review from a team August 14, 2026 20:17
@kalvinnchau
kalvinnchau merged commit c174a7d into main Aug 14, 2026
8 checks passed
@kalvinnchau
kalvinnchau deleted the fix/windows-just-bash-resolution branch August 14, 2026 20:51
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant