Skip to content

Commit 30e609e

Browse files
committed
Windows ARM64
1 parent 84e4a5c commit 30e609e

File tree

7 files changed

+59
-7
lines changed

7 files changed

+59
-7
lines changed

.buildkite/ci.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,8 @@ function getBuildCommand(target, options, label) {
474474

475475
if (target.os === "windows" && label === "build-bun") {
476476
// Only sign release builds, not canary builds (DigiCert charges per signature)
477-
const enableSigning = !options.canary ? " -DENABLE_WINDOWS_CODESIGNING=ON" : "";
477+
// Skip signing on ARM64 for now — smctl (x64-only) silently fails under emulation
478+
const enableSigning = !options.canary && target.arch !== "aarch64" ? " -DENABLE_WINDOWS_CODESIGNING=ON" : "";
478479
return `bun run build:${buildProfile}${enableSigning}`;
479480
}
480481

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ bunx cowsay 'Hello, world!' # execute a package
4343

4444
## Install
4545

46-
Bun supports Linux (x64 & arm64), macOS (x64 & Apple Silicon) and Windows (x64).
46+
Bun supports Linux (x64 & arm64), macOS (x64 & Apple Silicon) and Windows (x64 & arm64).
4747

4848
> **Linux users** — Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1.
4949

docs/bundler/executables.mdx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,31 @@ To build for Windows x64:
157157
</Tab>
158158
</Tabs>
159159

160+
To build for Windows arm64:
161+
162+
<Tabs>
163+
<Tab title="CLI">
164+
```bash icon="terminal" terminal
165+
bun build --compile --target=bun-windows-arm64 ./path/to/my/app.ts --outfile myapp
166+
167+
# note: if no .exe extension is provided, Bun will automatically add it for Windows executables
168+
```
169+
170+
</Tab>
171+
<Tab title="JavaScript">
172+
```ts build.ts icon="/icons/typescript.svg"
173+
await Bun.build({
174+
entrypoints: ["./path/to/my/app.ts"],
175+
compile: {
176+
target: "bun-windows-arm64",
177+
outfile: "./myapp", // .exe added automatically
178+
},
179+
});
180+
```
181+
182+
</Tab>
183+
</Tabs>
184+
160185
To build for macOS arm64:
161186

162187
<Tabs>
@@ -208,7 +233,7 @@ The order of the `--target` flag does not matter, as long as they're delimited b
208233
| bun-linux-x64 | Linux | x64 ||| glibc |
209234
| bun-linux-arm64 | Linux | arm64 || N/A | glibc |
210235
| bun-windows-x64 | Windows | x64 ||| - |
211-
| ~~bun-windows-arm64~~ | ~~Windows~~ | ~~arm64~~ | | | - |
236+
| bun-windows-arm64 | Windows | arm64 | | N/A | - |
212237
| bun-darwin-x64 | macOS | x64 ||| - |
213238
| bun-darwin-arm64 | macOS | arm64 || N/A | - |
214239
| bun-linux-x64-musl | Linux | x64 ||| musl |
@@ -1252,7 +1277,8 @@ type Target =
12521277
| "bun-linux-arm64-musl"
12531278
| "bun-windows-x64"
12541279
| "bun-windows-x64-baseline"
1255-
| "bun-windows-x64-modern";
1280+
| "bun-windows-x64-modern"
1281+
| "bun-windows-arm64";
12561282
```
12571283

12581284
### Complete example

docs/installation.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,13 @@ To download Bun binaries directly, visit the [releases page on GitHub](https://g
260260
>
261261
For older CPUs without AVX2
262262
</Card>
263+
<Card
264+
icon="/icons/windows.svg"
265+
title="Windows ARM64"
266+
href="https://github.com/oven-sh/bun/releases/latest/download/bun-windows-aarch64.zip"
267+
>
268+
Windows on ARM (Snapdragon, etc.)
269+
</Card>
263270
<Card
264271
icon="/icons/apple.svg"
265272
title="macOS ARM64"

scripts/bootstrap.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ function Install-Bun {
402402
}
403403

404404
if ($script:IsARM64) {
405-
# No published ARM64 bun binary yet — download from our blob storage
406-
Write-Output "Installing Bun (ARM64 from blob storage)..."
405+
# ARM64 bun binary from blob storage (faster than GitHub releases for CI)
406+
Write-Output "Installing Bun (ARM64)..."
407407
$zip = Download-File "https://buncistore.blob.core.windows.net/artifacts/bun-windows-aarch64.zip" -Name "bun-arm64.zip"
408408
$extractDir = "$env:TEMP\bun-arm64"
409409
Expand-Archive -Path $zip -DestinationPath $extractDir -Force

scripts/verify-baseline.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,13 @@ if (instructionFailures > 0) {
210210
console.error(" FAILED: Code uses unsupported CPU instructions.");
211211

212212
// Report to Buildkite annotations tab
213-
const platform = isWindows ? "Windows x64" : isAarch64 ? "Linux aarch64" : "Linux x64";
213+
const platform = isWindows
214+
? isAarch64
215+
? "Windows aarch64"
216+
: "Windows x64"
217+
: isAarch64
218+
? "Linux aarch64"
219+
: "Linux x64";
214220
const annotation = [
215221
`<details>`,
216222
`<summary>CPU instruction violation on ${platform}${instructionFailures} failed</summary>`,

test/cli/install/bun-upgrade.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ describe.concurrent(() => {
129129
"name": "bun-windows-x64-baseline.zip",
130130
"browser_download_url": `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-windows-x64-baseline.zip`,
131131
},
132+
{
133+
"url": "foo",
134+
"content_type": "application/zip",
135+
"name": "bun-windows-aarch64.zip",
136+
"browser_download_url": `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-windows-aarch64.zip`,
137+
},
132138
{
133139
"url": "foo",
134140
"content_type": "application/zip",
@@ -141,6 +147,12 @@ describe.concurrent(() => {
141147
"name": "bun-linux-x64-baseline.zip",
142148
"browser_download_url": `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-linux-x64-baseline.zip`,
143149
},
150+
{
151+
"url": "foo",
152+
"content_type": "application/zip",
153+
"name": "bun-linux-aarch64.zip",
154+
"browser_download_url": `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-linux-aarch64.zip`,
155+
},
144156
{
145157
"url": "foo",
146158
"content_type": "application/zip",

0 commit comments

Comments
 (0)