Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(bun): use native windows-arm64 build for Bun >= 1.3.10#10150

Merged
jdx merged 1 commit into
jdx:mainfrom
JamBalaya56562:fix/bun-windows-arm64-native
May 31, 2026
Merged

fix(bun): use native windows-arm64 build for Bun >= 1.3.10#10150
jdx merged 1 commit into
jdx:mainfrom
JamBalaya56562:fix/bun-windows-arm64-native

Conversation

@JamBalaya56562

Copy link
Copy Markdown
Contributor

Problem

The Bun plugin always downloads the x64-baseline build on Windows ARM64, running Bun under x64 emulation. Bun has shipped native Windows ARM64 archives (bun-windows-aarch64.zip) since v1.3.10, but mise never selected them.

Closes the request in discussion #10044.

Verified against the upstream Bun releases:

  • bun-v1.3.9 → only bun-windows-x64* assets (no aarch64)
  • bun-v1.3.10 → first release with bun-windows-aarch64.zip
  • bun-v1.3.14 (latest) → bun-windows-aarch64.zip present

Change

  • For Windows ARM64, select bun-windows-aarch64.zip when the Bun version is >= 1.3.10, and keep the x64-baseline fallback for older releases.
  • Unify the arch-resolution logic for the current system (get_bun_arch_with_variants) and for lockfile/platform targets (get_bun_arch_for_target) so the Windows ARM64 cutover lives in a single place. The download URL, the extracted directory name, and the lockfile asset/checksum all derive from the same bun-{os}-{arch}.zip helper, keeping them in sync.
  • Runtime AVX2 / musl detection is preserved (now routed through current_platform_targetget_platform_variant).
  • Non-semver refs (e.g. canary) prefer the native aarch64 archive rather than forcing x64 emulation.

All other platforms/variants (linux & macos x64/arm64, musl/baseline, windows x64) are unchanged.

This supersedes the earlier closed PRs #10045 and #10063, which took the same approach but stalled on unrelated Windows ARM64 CI runner issues.

Tests

Added unit tests in src/plugins/core/bun.rs:

  • windows_arm64_asset_filename_matches_bun_release_cutover1.3.9x64-baseline; 1.3.10 / v1.3.10 / bun-v1.3.10 / canaryaarch64.
  • bun_asset_filename_preserves_platform_variants — regression guard that every other platform/variant keeps its existing asset name.
cargo test --bin mise plugins::core::bun::   # 2 passed
cargo clippy --bin mise                      # no new warnings

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for native Windows ARM64 archives in the Bun plugin, which started publishing with version 1.3.10. For older versions, the plugin falls back to x64-baseline under emulation. The changes refactor the architecture and asset filename resolution to be version-aware, consolidate the platform-specific fallback logic, and add comprehensive unit tests to verify the cutover behavior and prevent regressions on other platforms. No review comments were provided, so there is no additional feedback.

@greptile-apps

greptile-apps Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR enables native Windows ARM64 (bun-windows-aarch64.zip) downloads for Bun >= 1.3.10 on windows-arm64 targets, while preserving the x64-baseline emulation fallback for older releases. The change centralises all arch/variant resolution into bun_asset_filenameget_bun_arch_for_targethas_native_windows_arm64_archive, eliminating the duplicate logic that existed between the download path and the lockfile-metadata path.

  • Cutover logic (has_native_windows_arm64_archive): strips bun-v/v prefixes, uses Versioning::is_ideal to distinguish concrete semver from channels like canary (non-semver falls through to native), and compares against the 1.3.10 constant.
  • Refactored helpers: get_bun_arch_with_variants now accepts version, current_platform_target builds a PlatformTarget from runtime AVX2/musl detection, and both get_github_release_info and resolve_lock_info use the same bun_asset_filename call.
  • Tests: two unit tests cover the cutover (including prefixed and non-semver version strings) and a regression suite for all other platform/variant combinations.

Confidence Score: 5/5

Safe to merge. The change is well-scoped to the Windows ARM64 download path, all other platforms are unchanged, and the cutover logic is covered by unit tests.

The Windows ARM64 arch selection is isolated in a single function with clear version-comparison logic. The has_native_windows_arm64_archive helper correctly strips version prefixes and treats non-semver refs (like canary) as preferring the native archive — a reasonable default given that canary tracks HEAD, which is well past the 1.3.10 cutover. All other platform/variant combinations (Linux musl/baseline, macOS, Windows x64) are exercised in the regression test and the match arms are unchanged from the pre-PR code. No data-loss, URL-construction, or lockfile-key issues were found.

No files require special attention.

Important Files Changed

Filename Overview
src/plugins/core/bun.rs Adds Windows ARM64 native archive support (>= 1.3.10) via a unified bun_asset_filename/get_bun_arch_for_target helper, replacing the always-x64-baseline Windows ARM64 path; refactors current-system arch lookup through current_platform_target, and adds unit tests covering the cutover and all other platform variants.

Reviews (2): Last reviewed commit: "fix(bun): use native windows-arm64 build..." | Re-trigger Greptile

Bun started publishing native Windows ARM64 archives
(bun-windows-aarch64.zip) in v1.3.10. mise previously always downloaded
the x64-baseline build on Windows ARM64, forcing emulation. Select the
native aarch64 archive for Bun >= 1.3.10 and keep the x64-baseline
fallback for older releases.

The arch-resolution logic for the current system and for lockfile
targets is unified into get_bun_arch_for_target so the Windows ARM64
cutover lives in a single place.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@JamBalaya56562 JamBalaya56562 force-pushed the fix/bun-windows-arm64-native branch from 4b2cbfb to ce6685c Compare May 31, 2026 03:08
@jdx jdx enabled auto-merge (squash) May 31, 2026 03:34
@jdx jdx merged commit 3116d39 into jdx:main May 31, 2026
32 checks passed
@JamBalaya56562 JamBalaya56562 deleted the fix/bun-windows-arm64-native branch May 31, 2026 03:49
This was referenced May 31, 2026
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.

2 participants