fix(bun): create bunx alongside bun.exe on Windows install#9732
Conversation
Greptile SummaryThis PR fixes the missing
Confidence Score: 5/5Safe to merge — the change is narrowly scoped to Windows install post-processing and is compile-time gated so it cannot regress Unix behaviour. The new No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "fix(bun): create bunx alongside bun.exe ..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request adds Windows-specific support for the Bun plugin to ensure bunx is available after installation, either via a hard link or a .cmd shim, and includes a new E2E test. The review feedback recommends using the internal file module for safer file cleanup and notes that the Bun version used in the tests is likely invalid and should be updated.
406aa5f to
0574d87
Compare
The upstream `bun-windows-*.zip` release ships `bun.exe` only — the `bunx` symlink that exists in the unix releases is created post-install by the bun PowerShell installer (which calls `bun completions`, see oven-sh/bun:src/cli/install_completions_command.zig `installBunxSymlinkWindows`). `mise install bun` skipped that step on Windows, leaving `bunx` unavailable: scripts that invoke `bunx <pkg>` (npm package.json scripts, Playwright `webServer.command`, mise tasks, etc.) all break under mise-managed bun on Windows. This patch mirrors the upstream shim-creation step: * Try a hardlink `bunx.exe -> bun.exe` first (matches upstream); bun inspects argv[0] and switches to bunx mode, so this is functionally identical to the unix symlink. * Fall back to a `bunx.cmd` shim with the same literal upstream uses (`@%~dp0bun.exe x %*`) for filesystems where hardlinks fail. mise's reshim picks up the new entry automatically because `.exe` and `.cmd` are both in the default `windows_executable_extensions`.
0574d87 to
69c3143
Compare
### 🚀 Features - add --inactive option to outdated and upgrade commands for inactive tools by @roele in [#9640](#9640) ### 🐛 Bug Fixes - **(aqua)** resolve bin paths for prefixed v tags by @risu729 in [#9759](#9759) - **(bun)** create bunx alongside bun.exe on Windows install by @JamBalaya56562 in [#9732](#9732) - **(dotnet)** use shared prerelease tool option by @risu729 in [#9720](#9720) - **(node)** use matching node in npm shim by @jdx in [#9749](#9749) - **(task)** resolve bash deterministically on Windows to avoid WSL launcher by @JamBalaya56562 in [#9750](#9750) ### 📚 Documentation - **(secrets)** clarify age strict mode default by @risu729 in [#9737](#9737) - **(tasks)** add bash shebang to conditional-dependencies example by @JamBalaya56562 in [#9747](#9747) - update backend tool option docs by @risu729 in [#9738](#9738) ### 📦 Registry - remove tools with zero users by @jdx in [#9725](#9725) - add scalafmt ([github:scalameta/scalafmt](https://github.com/scalameta/scalafmt)) by @pokir in [#9757](#9757) - remove flarectl by @risu729 in [#9756](#9756) ### Chore - **(release)** strip pre-existing sponsor block before appending canonical one by @jdx in [#9745](#9745) ### New Contributors - @pokir made their first contribution in [#9757](#9757)
Summary
mise install bunon Windows extractsbun.exefrom the upstreambun-windows-x64.ziprelease but does not create abunxentry, sobunx <pkg>is broken under mise-managed bun on Windows. The unixreleases include a
bunxsymlink pointing atbun, and the upstreamPowerShell installer mirrors that on Windows by calling
bun completions(oven-sh/bun:src/cli/install_completions_command.zig,installBunxSymlinkWindows). The mise core bun plugin had noequivalent, so package.json scripts, Playwright
webServer.command,mise tasks, etc. that invoke
bunxall failed.Reproduction (before this PR)
What changed
src/plugins/core/bun.rs: after extracting the Windows zip, createa
bunxentry next tobun.exe. Try a hardlinkbunx.exe -> bun.exefirst (matches upstream — bun inspects argv[0] and switches to bunx
mode the same way the unix symlink does), and fall back to a
bunx.cmdshim using the literal upstream uses(
@%~dp0bun.exe x %*) for filesystems where hardlinks fail.reshimpicks the new entry up automatically because both.exeand.cmdare in the defaultwindows_executable_extensions,so a
bunx.exeshim lands in~/AppData/Local/mise/shims/with no further plumbing.
e2e-win/bun.Tests.ps1: assert that the bun bin dir contains abunxentry after install and thatmise x bun -- bunx --versionreturns the expected version.
Test plan
mise install bun@1.3.13 --forceon Windows 11produces a working
bunx(verified end-to-end via the miseshim —
bunx --versionreturns1.3.13).cargo +stable-x86_64-pc-windows-msvc check -p miseclean(no new warnings).
cargo fmt --all -- --checkclean.bun.Tests.ps1).bunxsymlink intact (no regression; the new code is gated behind
#[cfg(windows)]).References
oven-sh/bun:src/cli/install_completions_command.zig
(
installBunxSymlinkWindows)oven-sh/bun:src/cli/install.ps1