fix: use native Windows ARM64 binary for Bun >= 1.3.10#165
fix: use native Windows ARM64 binary for Bun >= 1.3.10#165xhyrom merged 1 commit intooven-sh:mainfrom
Conversation
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]>
deba6d4 to
782c6a3
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Disabled knowledge base sources:
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
WalkthroughThis 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
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ 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). 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. Comment |
|
Potentially a duplicate of #163. Feel free to close if the other implementation is preferred. |
There was a problem hiding this comment.
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.
| // 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; | ||
| } |
There was a problem hiding this comment.
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).
|
thanks! |
|
@xhyrom, thank you for reviewing and merging my contribution. Please don't forget to cut a new release or move the |
Summary
bun-windows-aarch64.zipon Windows ARM64 runners when Bun version is >= 1.3.10canaryare treated as latest and use native ARM64hasNativeWindowsArm64()helper using the existingcompare-versionsdependencyCloses #164
Changes
src/utils.ts— AddedhasNativeWindowsArm64()predicate; madegetArchitecture()andgetAvx2()version-aware with an optionalversionparameter (backward-compatible)src/download-url.ts— Passes the resolved version tag togetArchitecture()andgetAvx2()tests/utils.spec.ts— Tests forhasNativeWindowsArm64, updatedgetArchitecture/getAvx2tests for version-aware behaviortests/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 actionBehavior
bun-windows-aarch64.zipbun-windows-x64-baseline.zip(with warning)bun-windows-aarch64.zipTest plan
windows-11-armrunner withbun-version: 1.3.10downloadsbun-windows-aarch64.zipwindows-11-armrunner with an olderbun-versionfalls back tobun-windows-x64-baseline.zipbun test)🤖 Generated with Claude Code