feat(release): publish Windows prebuilt artifacts#282
Conversation
Greptile SummaryThis PR adds Windows x64 to the prebuilt binary release pipeline: a new
Confidence Score: 3/5The release workflow and launcher changes are correct, but the smoke test will fail on Windows CI and on any machine where Bun and Node.js are installed in different directories. The launcher, package helpers, and release matrix changes are all correct and well-tested. The smoke test rewrite uses scripts/smoke-prebuilt-install.ts — the Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["npm install -g hunkdiff"] --> B["hunk / hunk.cmd wrapper created"]
B --> C["bin/hunk.cjs executed"]
C --> D{"hostCandidates()"}
D -->|darwin arm64| E["hunkdiff-darwin-arm64"]
D -->|darwin x64| F["hunkdiff-darwin-x64"]
D -->|linux arm64| G["hunkdiff-linux-arm64"]
D -->|linux x64| H["hunkdiff-linux-x64"]
D -->|windows x64 NEW| I["hunkdiff-windows-x64"]
E & F & G & H --> J["bin/hunk"]
I --> K["bin/hunk.exe"]
J & K --> L["findInstalledBinary()"]
L -->|found| M["spawnSync prebuilt binary"]
L -->|not found| N["fallback: bun runtime or error"]
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
scripts/smoke-prebuilt-install.ts:76-77
**`nodeDir` points to Bun, not Node.js — two distinct failures on the smoke test**
`process.execPath` is the Bun binary (this is a `#!/usr/bin/env bun` script), so `nodeDir` becomes Bun's installation directory rather than Node.js's. On GitHub Actions (and most developer machines) Bun and Node.js live in different directories, so this has two consequences:
1. The npm-created `hunk.cmd` wrapper calls `node` relative to `PATH`. With node's directory absent from `sanitizedPath`, running `installedHunk` fails immediately because `node` cannot be found.
2. Bun's directory is now in `sanitizedPath`. The `bunCheck` below spawns `bun` under `commandEnv` — it will find Bun and exit 1, triggering `"bun unexpectedly available on the prebuilt install smoke-test PATH"`.
The cross-platform `commandDirectory` helper introduced in this same PR already handles Windows (`where node`) and Unix (`bash -lc "command -v node"`), so the fix is to use it here: `const nodeDir = commandDirectory("node");`.
Reviews (1): Last reviewed commit: "feat(release): publish Windows prebuilt ..." | Re-trigger Greptile |
| const nodeDir = path.dirname(process.execPath); | ||
| const bashDir = commandDirectory("bash"); |
There was a problem hiding this comment.
nodeDir points to Bun, not Node.js — two distinct failures on the smoke test
process.execPath is the Bun binary (this is a #!/usr/bin/env bun script), so nodeDir becomes Bun's installation directory rather than Node.js's. On GitHub Actions (and most developer machines) Bun and Node.js live in different directories, so this has two consequences:
- The npm-created
hunk.cmdwrapper callsnoderelative toPATH. With node's directory absent fromsanitizedPath, runninginstalledHunkfails immediately becausenodecannot be found. - Bun's directory is now in
sanitizedPath. ThebunCheckbelow spawnsbunundercommandEnv— it will find Bun and exit 1, triggering"bun unexpectedly available on the prebuilt install smoke-test PATH".
The cross-platform commandDirectory helper introduced in this same PR already handles Windows (where node) and Unix (bash -lc "command -v node"), so the fix is to use it here: const nodeDir = commandDirectory("node");.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/smoke-prebuilt-install.ts
Line: 76-77
Comment:
**`nodeDir` points to Bun, not Node.js — two distinct failures on the smoke test**
`process.execPath` is the Bun binary (this is a `#!/usr/bin/env bun` script), so `nodeDir` becomes Bun's installation directory rather than Node.js's. On GitHub Actions (and most developer machines) Bun and Node.js live in different directories, so this has two consequences:
1. The npm-created `hunk.cmd` wrapper calls `node` relative to `PATH`. With node's directory absent from `sanitizedPath`, running `installedHunk` fails immediately because `node` cannot be found.
2. Bun's directory is now in `sanitizedPath`. The `bunCheck` below spawns `bun` under `commandEnv` — it will find Bun and exit 1, triggering `"bun unexpectedly available on the prebuilt install smoke-test PATH"`.
The cross-platform `commandDirectory` helper introduced in this same PR already handles Windows (`where node`) and Unix (`bash -lc "command -v node"`), so the fix is to use it here: `const nodeDir = commandDirectory("node");`.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Fixed in the latest push: the smoke test now resolves the real node path with the cross-platform command lookup and derives nodeDir from that path, so the sanitized PATH includes Node without accidentally including Bun. The release workflow dry-run passed afterward.
This comment was generated by Pi using GPT-5
c3b5f4d to
18ad36a
Compare
Summary
hunkdiff-windows-x64to the prebuilt npm release build matrix..exeoutputs, and global npm prefix layout.Testing
bun run format:checkbun run typecheckbun test scripts/prebuilt-package-helpers.test.tsbun run build:prebuilt:npmbun run check:prebuilt-packbun run smoke:prebuilt-installbun run lintThis PR description was generated by Pi using GPT-5