Skip to content

fix(cli): find the .exe shims when bun installed the project on Windows - #1411

Merged
Simon Ingeson (smonn) merged 1 commit into
mainfrom
wiz-11281-windows-resolveplaywrightcli-fails-when-the-project
Jul 30, 2026
Merged

fix(cli): find the .exe shims when bun installed the project on Windows#1411
Simon Ingeson (smonn) merged 1 commit into
mainfrom
wiz-11281-windows-resolveplaywrightcli-fails-when-the-project

Conversation

@smonn

@smonn Simon Ingeson (smonn) commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Relates to WIZ-11281, WIZ-11286

Overview of Changes

bun install on Windows writes playwright.exe and appium.exe into node_modules/.bin, not the .cmd wrappers npm writes, so the CLI reported Playwright missing and Android flows failed on projects that had both installed. A windows-latest probe recorded on WIZ-11281 confirmed the shim names. Both candidate lists now include the .exe.

allPinnedResolved carried a second copy of the Playwright name list, which is why a bun-installed project also reinstalled the runtime on every run. It now shares the platform-parameterized list, so the two cannot drift. That sharing also tightens POSIX to reject a lone .cmd, which is why this is one fix commit and not the structural/behavioral split it started as — reusing the shared list is the behavior change, so no ordering makes the first commit behavior-preserving. resolveAppiumBin returned a single path and could not express a candidate list, so it is gone and its three callers select via checkExists, matching the Playwright shape.

playwright.bunx and appium.bunx are deliberately skipped, against WIZ-11281's suggested fix: those are bun's metadata shims rather than PE images, buildSpawnCommand routes only .cmd/.bat through cmd.exe, and bun always writes the runnable .exe beside them. Both win32 lists still end in the extension-less shim; whether that entry is reachable on Windows is unproven and tracked in WIZ-11286, which requires a CI probe before anyone deletes it.

Testing

Platform-parameterized unit tests cover both candidate lists and both consumers: src/core/playwrightBins.test.ts, src/core/appiumBins.test.ts, src/domains/runtimeEnv/resolvePinned.test.ts (a win32 dir holding only playwright.exe now resolves), and src/domains/doctor/checks/playwright.test.ts (doctor spawns the .exe when bun wrote no .cmd). The win32 legs assert against injected platforms, so they run on any host.

bun run typecheck
bun run lint
bun run format:check
bun run knip
bun run test
bun run build

All clean locally: 1224 tests pass, 0 fail.

Checklist

  • Changes follow the code style of this project
  • Self-review completed
  • Tests added/updated (or not applicable)
  • No breaking changes (or described below)

bun install writes playwright.exe and appium.exe into node_modules/.bin, not
the .cmd wrappers npm writes, so the CLI reported Playwright missing and
Android flows failed on projects that had both installed.

allPinnedResolved carried a second copy of the playwright name list. It now
shares the platform-parameterized one, which also tightens POSIX to reject a
lone .cmd. The platform is a required argument through every caller so one
value decides both the resolved path and the spawn.

Skipping playwright.bunx and appium.bunx: those are bun's metadata shims, not
PE images, and buildSpawnCommand routes only .cmd and .bat through cmd.exe,
so CreateProcess cannot run them. bun always writes the .exe beside them.
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The CLI now recognizes platform-specific Playwright and Appium shims, including .exe files produced by Bun on Windows. Runtime dependency resolution APIs require and propagate platform through command, environment, and installation flows. Pinned dependency checks use platform-aware Playwright candidates. Doctor checks, Android driver installation, and Appium server setup select existing Appium candidates, with a dedicated missing-Appium error message. Tests cover Windows and non-Windows candidate behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLICommand
  participant RuntimeEnvironment
  participant ShimCandidates
  participant FileSystem
  CLICommand->>RuntimeEnvironment: resolve dependencies with process.platform
  RuntimeEnvironment->>ShimCandidates: request Playwright/Appium candidates
  ShimCandidates-->>RuntimeEnvironment: return platform-specific paths
  RuntimeEnvironment->>FileSystem: check candidate existence
  FileSystem-->>RuntimeEnvironment: return resolved runtime path
Loading

Possibly related PRs

  • qawolf/cli#1405: Updates Windows Appium binary resolution and related Android and doctor flows.
  • qawolf/cli#1409: Refactors platform-aware Playwright shim resolution and downstream consumers.

Suggested reviewers: michael-pr

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title follows Conventional Commits and clearly describes the Windows Bun .exe shim fix in cli.
Description check ✅ Passed The description matches the template with overview, testing commands, and checklist items filled in.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wiz-11281-windows-resolveplaywrightcli-fails-when-the-project

Comment @coderabbitai help to get the list of available commands.

@smonn
Simon Ingeson (smonn) marked this pull request as ready for review July 30, 2026 20:05
@smonn
Simon Ingeson (smonn) merged commit b93c3de into main Jul 30, 2026
7 checks passed
@smonn
Simon Ingeson (smonn) deleted the wiz-11281-windows-resolveplaywrightcli-fails-when-the-project branch July 30, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants