"arch()" function reports wrong value on Windows-on-Arm machines
- Dominant language
- Rust
- Stars
- 35.8k
- Forks
- 846
- Avg merge
- 27m
- Merged PRs (30d)
- 3
Description
On a MS Surface Pro X (aarch64 processor), the `arch()` function returns `x86_64` instead of `aarch64`.
I wonder if `arch()` is reporting the architecture of the `just` binary, rather than the underlying processor. (There is no WoA version of `just`, so `winget` installs the `x86_64` version, which WoA is happy to run via emulation.)
justfile
```make
set windows-shell := ["pwsh", "-Command"]
set shell := ["bash"]
sysinfo:
@echo "This is an {{arch()}} machine with {{num_cpus()}} cores running {{os()}}"
sysinfo-pwsh:
@Echo "This is an {{arch()}} machine with {{num_cpus()}} cores running {{os()}}"
```
Powershell output:
```bash
PS C:\Users\hwine> just sysinfo-pwsh
This is an x86_64 machine with 8 cores running windows
```
Git for windows output:
```bash
❯ just sysinfo
This is an x86_64 machine with 8 cores running windows
❯ uname -a
MINGW64_NT-10.0-26120-ARM64 surfacex 3.6.3-7674c51e.x86_64 2025-07-01 09:13 UTC x86_64 Msys
❯ file $(type -p just)
/c/Users/hwine/AppData/Local/Microsoft/WinGet/Packages/Casey.Just_Microsoft.Winget.Source_8wekyb3d8bbwe/just: PE32+ executable for MS Windows 6.00 (console), x86-64, 6 sections
```
Contributor guide
Assessment
This issue has not been assessed yet.