GeezerVison is showing github.com — feat(windows): add arm64 release targets for cli and desktop (#16696) · zwying/opencode@547eb76
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/workflows/publish.yml +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -115,6 +115,9 @@ jobs: | 115 | 115 | target: x86_64-apple-darwin | 116 | 116 | - host: macos-latest | 117 | 117 | target: aarch64-apple-darwin | | 118 | + # github-hosted: blacksmith lacks ARM64 MSVC cross-compilation toolchain | | 119 | + - host: windows-2025 | | 120 | + target: aarch64-pc-windows-msvc | 118 | 121 | - host: blacksmith-4vcpu-windows-2025 | 119 | 122 | target: x86_64-pc-windows-msvc | 120 | 123 | - host: blacksmith-4vcpu-ubuntu-2404 | @@ -258,6 +261,10 @@ jobs: | 258 | 261 | - host: macos-latest | 259 | 262 | target: aarch64-apple-darwin | 260 | 263 | platform_flag: --mac --arm64 | | 264 | + # github-hosted: blacksmith lacks ARM64 MSVC cross-compilation toolchain | | 265 | + - host: "windows-2025" | | 266 | + target: aarch64-pc-windows-msvc | | 267 | + platform_flag: --win --arm64 | 261 | 268 | - host: "blacksmith-4vcpu-windows-2025" | 262 | 269 | target: x86_64-pc-windows-msvc | 263 | 270 | platform_flag: --win | |
Collapse file Copy file name to clipboardExpand all lines: packages/desktop-electron/scripts/finalize-latest-yml.ts +11-3Lines changed: 11 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -78,9 +78,17 @@ async function read(subdir: string, filename: string): Promise<LatestYml | undef | 78 | 78 |
| 79 | 79 | const output: Record<string, string> = {} | 80 | 80 |
| 81 | | -// Windows: single arch, pass through | 82 | | -const win = await read("latest-yml-x86_64-pc-windows-msvc", "latest.yml") | 83 | | -if (win) output["latest.yml"] = serialize(win) | | 81 | +// Windows: merge arm64 + x64 into single file | | 82 | +const winX64 = await read("latest-yml-x86_64-pc-windows-msvc", "latest.yml") | | 83 | +const winArm64 = await read("latest-yml-aarch64-pc-windows-msvc", "latest.yml") | | 84 | +if (winX64 || winArm64) { | | 85 | + const base = winArm64 ?? winX64! | | 86 | + output["latest.yml"] = serialize({ | | 87 | + version: base.version, | | 88 | + files: [...(winArm64?.files ?? []), ...(winX64?.files ?? [])], | | 89 | + releaseDate: base.releaseDate, | | 90 | + }) | | 91 | +} | 84 | 92 |
| 85 | 93 | // Linux x64: pass through | 86 | 94 | const linuxX64 = await read("latest-yml-x86_64-unknown-linux-gnu", "latest-linux.yml") | |
Collapse file Copy file name to clipboardExpand all lines: packages/desktop-electron/scripts/utils.ts +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -19,6 +19,11 @@ export const SIDECAR_BINARIES: Array<{ rustTarget: string; ocBinary: string; ass | 19 | 19 | ocBinary: "opencode-darwin-x64-baseline", | 20 | 20 | assetExt: "zip", | 21 | 21 | }, | | 22 | + { | | 23 | + rustTarget: "aarch64-pc-windows-msvc", | | 24 | + ocBinary: "opencode-windows-arm64", | | 25 | + assetExt: "zip", | | 26 | + }, | 22 | 27 | { | 23 | 28 | rustTarget: "x86_64-pc-windows-msvc", | 24 | 29 | ocBinary: "opencode-windows-x64-baseline", | @@ -41,7 +46,7 @@ export const RUST_TARGET = Bun.env.RUST_TARGET | 41 | 46 | function nativeTarget() { | 42 | 47 | const { platform, arch } = process | 43 | 48 | if (platform === "darwin") return arch === "arm64" ? "aarch64-apple-darwin" : "x86_64-apple-darwin" | 44 | | - if (platform === "win32") return "x86_64-pc-windows-msvc" | | 49 | + if (platform === "win32") return arch === "arm64" ? "aarch64-pc-windows-msvc" : "x86_64-pc-windows-msvc" | 45 | 50 | if (platform === "linux") return arch === "arm64" ? "aarch64-unknown-linux-gnu" : "x86_64-unknown-linux-gnu" | 46 | 51 | throw new Error(`Unsupported platform: ${platform}/${arch}`) | 47 | 52 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/desktop/scripts/finalize-latest-json.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -101,6 +101,7 @@ const targets = [ | 101 | 101 | { key: "linux-x86_64-rpm", asset: "opencode-desktop-linux-x86_64.rpm" }, | 102 | 102 | { key: "linux-aarch64-deb", asset: "opencode-desktop-linux-arm64.deb" }, | 103 | 103 | { key: "linux-aarch64-rpm", asset: "opencode-desktop-linux-aarch64.rpm" }, | | 104 | + { key: "windows-aarch64-nsis", asset: "opencode-desktop-windows-arm64.exe" }, | 104 | 105 | { key: "windows-x86_64-nsis", asset: "opencode-desktop-windows-x64.exe" }, | 105 | 106 | { key: "darwin-x86_64-app", asset: "opencode-desktop-darwin-x64.app.tar.gz" }, | 106 | 107 | { | @@ -129,6 +130,7 @@ const alias = (key: string, source: string) => { | 129 | 130 |
| 130 | 131 | alias("linux-x86_64", "linux-x86_64-deb") | 131 | 132 | alias("linux-aarch64", "linux-aarch64-deb") | | 133 | +alias("windows-aarch64", "windows-aarch64-nsis") | 132 | 134 | alias("windows-x86_64", "windows-x86_64-nsis") | 133 | 135 | alias("darwin-x86_64", "darwin-x86_64-app") | 134 | 136 | alias("darwin-aarch64", "darwin-aarch64-app") | |
Collapse file Copy file name to clipboardExpand all lines: packages/desktop/scripts/utils.ts +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -11,6 +11,11 @@ export const SIDECAR_BINARIES: Array<{ rustTarget: string; ocBinary: string; ass | 11 | 11 | ocBinary: "opencode-darwin-x64-baseline", | 12 | 12 | assetExt: "zip", | 13 | 13 | }, | | 14 | + { | | 15 | + rustTarget: "aarch64-pc-windows-msvc", | | 16 | + ocBinary: "opencode-windows-arm64", | | 17 | + assetExt: "zip", | | 18 | + }, | 14 | 19 | { | 15 | 20 | rustTarget: "x86_64-pc-windows-msvc", | 16 | 21 | ocBinary: "opencode-windows-x64-baseline", | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/package.json +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 36 | 36 | "@parcel/watcher-linux-arm64-musl": "2.5.1", | 37 | 37 | "@parcel/watcher-linux-x64-glibc": "2.5.1", | 38 | 38 | "@parcel/watcher-linux-x64-musl": "2.5.1", | | 39 | + "@parcel/watcher-win32-arm64": "2.5.1", | 39 | 40 | "@parcel/watcher-win32-x64": "2.5.1", | 40 | 41 | "@standard-schema/spec": "1.0.0", | 41 | 42 | "@tsconfig/bun": "catalog:", | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/script/build.ts +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -108,6 +108,10 @@ const allTargets: { | 108 | 108 | arch: "x64", | 109 | 109 | avx2: false, | 110 | 110 | }, | | 111 | + { | | 112 | + os: "win32", | | 113 | + arch: "arm64", | | 114 | + }, | 111 | 115 | { | 112 | 116 | os: "win32", | 113 | 117 | arch: "x64", | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/file/ripgrep.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -100,6 +100,7 @@ export namespace Ripgrep { | 100 | 100 | }, | 101 | 101 | "x64-darwin": { platform: "x86_64-apple-darwin", extension: "tar.gz" }, | 102 | 102 | "x64-linux": { platform: "x86_64-unknown-linux-musl", extension: "tar.gz" }, | | 103 | + "arm64-win32": { platform: "aarch64-pc-windows-msvc", extension: "zip" }, | 103 | 104 | "x64-win32": { platform: "x86_64-pc-windows-msvc", extension: "zip" }, | 104 | 105 | } as const | 105 | 106 |
| |
|