Skip to content

Fix ARM64 detection on macOS with Rosetta 2#60

Merged
jpillora merged 1 commit intojpillora:masterfrom
slavaGanzin:fix-macos-arm64-detection
Nov 27, 2025
Merged

Fix ARM64 detection on macOS with Rosetta 2#60
jpillora merged 1 commit intojpillora:masterfrom
slavaGanzin:fix-macos-arm64-detection

Conversation

@slavaGanzin
Copy link
Contributor

@slavaGanzin slavaGanzin commented Nov 26, 2025

Hi Jaime @jpillora , thanks for your work!

Adds sysctl hw.optional.arm64 check before uname -m checks to correctly detect Apple Silicon Macs even when shell runs under Rosetta 2 translation.

Problem: uname -m returns x86_64 when terminal runs under Rosetta, causing installer to download x86_64 binaries instead of native arm64 binaries.

Solution: Check sysctl hw.optional.arm64 on macOS first, which returns 1 on Apple Silicon regardless of Rosetta state (run only on Mac).

Tested: Correctly installs arm64 binaries on M2 Mac, no AVX warnings.

Adds sysctl hw.optional.arm64 check before uname -m checks to correctly
detect Apple Silicon Macs even when shell runs under Rosetta 2 translation.

Problem: uname -m returns x86_64 when terminal runs under Rosetta, causing
installer to download x86_64 binaries instead of native arm64 binaries.

Solution: Check sysctl hw.optional.arm64 on macOS first, which returns 1
on Apple Silicon regardless of Rosetta state.

Tested: Correctly installs arm64 binaries on M2 Mac, no AVX warnings.
@jpillora jpillora merged commit 6f07a1e into jpillora:master Nov 27, 2025
4 checks passed
Repository owner deleted a comment from jpagent Nov 27, 2025
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