Skip to content

fix: use native Windows ARM64 binary for Bun >= 1.3.10#165

Merged
xhyrom merged 1 commit intooven-sh:mainfrom
oddrationale:fix/windows-arm64-native
Feb 26, 2026
Merged

fix: use native Windows ARM64 binary for Bun >= 1.3.10#165
xhyrom merged 1 commit intooven-sh:mainfrom
oddrationale:fix/windows-arm64-native

Conversation

@oddrationale
Copy link
Copy Markdown
Contributor

@oddrationale oddrationale commented Feb 26, 2026

Summary

  • Use native bun-windows-aarch64.zip on Windows ARM64 runners when Bun version is >= 1.3.10
  • Preserve the existing x64 baseline fallback for older versions that lack ARM64 assets
  • Non-semver versions like canary are treated as latest and use native ARM64
  • Add version-aware hasNativeWindowsArm64() helper using the existing compare-versions dependency

Closes #164

Changes

  • src/utils.ts — Added hasNativeWindowsArm64() predicate; made getArchitecture() and getAvx2() version-aware with an optional version parameter (backward-compatible)
  • src/download-url.ts — Passes the resolved version tag to getArchitecture() and getAvx2()
  • tests/utils.spec.ts — Tests for hasNativeWindowsArm64, updated getArchitecture/getAvx2 tests for version-aware behavior
  • tests/download-url.spec.ts — Added Windows ARM64 URL tests (native aarch64 for >= 1.3.10, x64-baseline fallback for older, canary native, dynamic version resolution)
  • dist/ — Rebuilt bundled action

Behavior

Scenario Result
Windows ARM64 + Bun >= 1.3.10 bun-windows-aarch64.zip
Windows ARM64 + Bun < 1.3.10 bun-windows-x64-baseline.zip (with warning)
Windows ARM64 + canary bun-windows-aarch64.zip
All other platforms Unchanged

Test plan

  • Verify windows-11-arm runner with bun-version: 1.3.10 downloads bun-windows-aarch64.zip
  • Verify windows-11-arm runner with an older bun-version falls back to bun-windows-x64-baseline.zip
  • Verify non-Windows and non-ARM64 platforms are unaffected
  • All 58 unit tests pass (bun test)

🤖 Generated with Claude Code

Bun v1.3.10 ships native Windows ARM64 binaries. Update
getArchitecture() and getAvx2() to be version-aware so that
windows-11-arm runners download bun-windows-aarch64.zip instead of
falling back to bun-windows-x64-baseline.zip. The x64 fallback is
preserved for older versions that lack ARM64 assets.

Closes #164

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@oddrationale oddrationale force-pushed the fix/windows-arm64-native branch from deba6d4 to 782c6a3 Compare February 26, 2026 20:12
@oddrationale oddrationale marked this pull request as ready for review February 26, 2026 20:13
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ab8cb4e and 782c6a3.

⛔ Files ignored due to path filters (1)
  • dist/setup/index.js is excluded by !**/dist/**
📒 Files selected for processing (5)
  • .github/workflows/test.yml
  • src/download-url.ts
  • src/utils.ts
  • tests/download-url.spec.ts
  • tests/utils.spec.ts

Walkthrough

This PR adds version-aware Windows ARM64 native binary support for Bun. It introduces a function to detect if a version ships native ARM64 binaries, updates architecture and AVX2 decision logic to accept version parameters, and expands test coverage for multiple Bun versions on Windows ARM64 hardware.

Changes

Cohort / File(s) Summary
CI Configuration
.github/workflows/test.yml
Adds Bun v1.3.10 to the version matrix for test coverage expansion.
Core Utilities
src/utils.ts, src/download-url.ts
Introduces hasNativeWindowsArm64(version?) function to determine native ARM64 availability per Bun version. Updates getArchitecture() and getAvx2() signatures to accept optional version parameter for version-aware Windows ARM64 fallback logic. download-url.ts now passes resolved tag consistently to these functions.
Test Suite
tests/utils.spec.ts, tests/download-url.spec.ts
Expands test coverage for Windows ARM64 scenarios across Bun versions (1.3.9, 1.3.10, 1.4.0). Adds test branches for native ARM64 binary usage vs. x64 fallback based on version availability and validates dynamic version resolution with updated API call expectations.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: enabling native Windows ARM64 binary usage for Bun versions >= 1.3.10, which aligns with the primary objective of the pull request.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the behavior changes, implementation approach, modified files, and test plan.
Linked Issues check ✅ Passed The pull request fully addresses issue #164 by implementing version-aware Windows ARM64 support: using native aarch64 binaries for Bun >= 1.3.10, preserving x64 fallback for older versions, and treating non-semver versions as latest.
Out of Scope Changes check ✅ Passed All code changes are directly related to the Windows ARM64 native binary support objective. The workflow test matrix addition is a supporting change to ensure the new version is tested.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@oddrationale
Copy link
Copy Markdown
Contributor Author

Potentially a duplicate of #163. Feel free to close if the other implementation is preferred.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds support for native Windows ARM64 binaries in Bun versions >= 1.3.10, while maintaining backward compatibility with older versions that only support x64 emulation on Windows ARM64 runners. The implementation uses version comparison to determine whether to download the native bun-windows-aarch64.zip or fall back to bun-windows-x64-baseline.zip.

Changes:

  • Added version-aware architecture and AVX2 detection for Windows ARM64 platforms
  • Introduced hasNativeWindowsArm64() helper function to determine if a Bun version supports native Windows ARM64
  • Updated warning messages to recommend upgrading to Bun >= 1.3.10 for native ARM64 support

Reviewed changes

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

Show a summary per file
File Description
src/utils.ts Added hasNativeWindowsArm64() function and made getArchitecture() and getAvx2() version-aware with optional version parameter
src/download-url.ts Updated to pass resolved version tag to architecture and AVX2 detection functions
tests/utils.spec.ts Added comprehensive tests for hasNativeWindowsArm64() and updated tests for version-aware behavior in getArchitecture() and getAvx2()
tests/download-url.spec.ts Added Windows ARM64 test cases covering native binaries, fallback behavior, and dynamic version resolution
.github/workflows/test.yml Added Bun v1.3.10 to the test matrix to verify native ARM64 support

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

Comment on lines +92 to 99
// Workaround for absence of arm64 builds on Windows before 1.3.10 (#130)
if (os === "windows" && (arch === "aarch64" || arch === "arm64")) {
return false;
if (!hasNativeWindowsArm64(version)) {
return false;
}
// Native ARM64 builds don't use AVX2 suffix
return true;
}
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The getAvx2 function ignores the user-provided avx2 parameter when Windows ARM64 has native support (>= 1.3.10). While this is likely intentional since ARM64 doesn't support AVX2, it would be good to add test coverage for this behavior to ensure that when a user explicitly sets avx2: false for Windows ARM64 >= 1.3.10, the function still returns true (to avoid adding the -baseline suffix for native ARM64 binaries).

Copilot uses AI. Check for mistakes.
@xhyrom
Copy link
Copy Markdown
Collaborator

xhyrom commented Feb 26, 2026

thanks!

@xhyrom xhyrom merged commit 0ff83bf into oven-sh:main Feb 26, 2026
91 checks passed
@oddrationale oddrationale deleted the fix/windows-arm64-native branch February 26, 2026 22:24
@oddrationale
Copy link
Copy Markdown
Contributor Author

@xhyrom, thank you for reviewing and merging my contribution. Please don't forget to cut a new release or move the v2 tag. Thanks!

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.

Use native Windows ARM64 binary now that Bun v1.3.10 ships bun-windows-aarch64

3 participants