Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix detection of aarch64 host on Windows #3010

Merged
merged 1 commit into from
Jun 15, 2022
Merged

Conversation

arlosi
Copy link
Contributor

@arlosi arlosi commented Jun 14, 2022

rustup does not currently auto-detect aarch64-pc-windows-msvc hosts. Instead x86_64-pc-windows-msvc is used because GetNativeSystemInfo does not support detection of aarch64 hosts.

From the docs:

If the function is called from an x86 or x64 application running on a 64-bit system that does not have an Intel64 or x64 processor (such as ARM64), it will return information as if the system is x86 only if x86 emulation is supported (or x64 if x64 emulation is also supported).

The alternative function used in this change IsWow64Process2 supports detecting aarch64 hosts.

@arlosi
Copy link
Contributor Author

arlosi commented Jun 14, 2022

I should note that IsWow64Process2 is only available on Windows 10 or newer. Is that acceptable? I couldn't find the minimum requirements for rustup.

If we need to go back further, I can do runtime detection of whether the function is available.

@ChrisDenton
Copy link
Member

Note that Rust itself currently supports Windows 7+. Presumably rustup should attempt to do the same unless the maintenance burden gets too high.

src/dist/dist.rs Outdated Show resolved Hide resolved
@arlosi
Copy link
Contributor Author

arlosi commented Jun 14, 2022

I've updated the PR to use runtime detection of IsWow64Process2 with a fallback to the original method using GetNativeSystemInfo

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.

4 participants