Skip to content

fix: resolve bun/pnpm global install failures on Windows - #4275

Merged
rekram1-node merged 11 commits into
anomalyco:devfrom
Hona:fix/bun-windows
Nov 13, 2025
Merged

rekram1-node merged 11 commits into
anomalyco:devfrom
Hona:fix/bun-windows

Conversation

@Hona

@Hona Hona commented Nov 13, 2025

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings November 13, 2025 06:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes bun/pnpm global install failures on Windows by simplifying the installation approach: instead of using complex postinstall scripts to copy binaries, the Windows .exe is now included directly in the published package with the bin field pointing to it.

Key changes:

  • Replaced shell commands with Node.js fs APIs for cross-platform compatibility
  • Standardized Windows platform naming to "win32" in build configuration
  • Simplified Windows postinstall logic to skip setup (binary already packaged)

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
packages/opencode/script/publish.ts Replaced shell commands with fs APIs; added Windows .exe copying logic; updated process.chdir calls for publishing
packages/opencode/script/postinstall.mjs Removed Windows-specific binary copying and npm wrapper regeneration; Windows now exits early as binary is pre-packaged
packages/opencode/script/build.ts Changed Windows OS identifier from "windows" to "win32" for consistency with process.platform

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/opencode/script/publish.ts Resolved
Comment thread packages/opencode/script/publish.ts Resolved
Comment thread packages/opencode/script/publish.ts Resolved
Comment thread packages/opencode/script/publish.ts Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +69 to +73
os: "win32",
arch: "x64",
},
{
os: "windows",
os: "win32",

Copilot AI Nov 13, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The opencode.cmd wrapper script uses platform=windows to construct the package name opencode-windows-x64, but after this change, the Windows packages are now published as opencode-win32-x64. This mismatch will cause the .cmd wrapper to fail to locate the binary package on Windows.

The platform variable in bin/opencode.cmd (line 14) should be changed to win32 to match the new package naming convention.

Copilot uses AI. Check for mistakes.
@rekram1-node
rekram1-node merged commit 7344358 into anomalyco:dev Nov 13, 2025
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
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.

3 participants