Repository navigation
fix(desktop): bundle arm64 binaries for windows arm - #54689
Merged
Merged
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Contributor
There was a problem hiding this comment.
The change looks correct. I couldn't verify it end to end, because that needs a Windows ARM64 CI build and machine.
On Linux I loaded both configs through the loaders the build tools actually use: electron-vite's loadConfigFromFile, and jiti for electron-builder.
- With
OPENCODE_CLI_TARGET=aarch64-pc-windows-msvc, the main build externalizes@lydell/node-pty-win32-arm64, and electron-builder excludes the other five node-pty packages. Without a target, both still fall back to the host. - The
afterPackpath matches the published@lydell/node-pty-win32-arm64@1.2.0-beta.12layout (prebuilds/win32-arm64/conpty.node). bun-pty0.4.11 shipsrust_pty_arm64.dlland selects it onwin32/arm64.- The desktop config tests pass (9/9), and
tsgo -bis clean.
Public API: unchanged. OPENCODE_CLI_TARGET was already read by the desktop scripts; it now also drives the vite and electron-builder configs, with the same host fallback, and is set in the publish workflow's packaging steps.
No blocking concerns.
Related: #44664
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #45875
Type of change
What does this PR do?
Fixes two places where the Windows ARM64 desktop build bundled x64 native binaries:
aarch64-pc-windows-msvcElectron job runs on an x64windows-2025host withoutbun_install_flags: --cpu=*, andelectron.vite.config.tsresolved@lydell/node-ptyusingprocess.platform/process.archinstead ofOPENCODE_CLI_TARGET. As a result,opencode-desktop-win-arm64.exepackaged@lydell/node-pty-win32-x64. This resolves thenode-ptypackage fromOPENCODE_CLI_TARGET, installs--cpu=*for the Windows ARM64 CI build, excludes non-target@lydell/node-pty-*packages fromelectron-builder, and verifies the targetconpty.nodeprebuild inafterPack.packages/corepinnedbun-ptyto0.4.9, which only shipped an x64rust_pty.dlland embedded it intocli-windows-arm64/bin/opencode.exe(failingdlopenwith Windows error 193 on ARM64). Bumpingbun-ptyto0.4.11embedsrust_pty_arm64.dllwhen compiling forwin32-arm64.electron-viteandelectron-builderconfigs directly in their unit tests instead of spawningesbuildvialoadConfigFromFileon every call, cutting those two test files from ~7.6s to ~1.7s.How did you verify your code works?
bun test ./electron.vite.config.test.ts ./electron-builder.config.test.tsinpackages/desktop(verifying cross-architectureOPENCODE_CLI_TARGETresolution andFileMatcherfiltering across all targets).bun typecheckinpackages/coreandbun run lint:changed.rust_pty_arm64.dllinbun-pty@0.4.11has PE machine type0xaa64(ARM64).Screenshots / recordings
N/A (build and packaging fix)
Checklist
Added by the opencode bot (AI-generated).
Related: #44664