Allow use of x86-64 Python on ARM Windows (#11625)

Closes https://github.com/astral-sh/uv/issues/11493
This commit is contained in:
Zanie Blue 2025-02-19 12:01:46 -06:00 committed by GitHub
parent 80b0d4c4e2
commit fdebc0c7fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 7 deletions

View file

@ -103,6 +103,26 @@ impl Arch {
}
}
/// Does the current architecture support running the other?
///
/// When the architecture is equal, this is always true. Otherwise, this is true if the
/// architecture is transparently emulated or is a microarchitecture with worse performance
/// characteristics.
pub(crate) fn supports(self, other: Self) -> bool {
if self == other {
return true;
}
// TODO: Implement `variant` support checks
// Windows ARM64 runs emulated x86_64 binaries transparently
if cfg!(windows) && matches!(self.family, target_lexicon::Architecture::Aarch64(_)) {
return other.family == target_lexicon::Architecture::X86_64;
}
false
}
pub fn family(&self) -> target_lexicon::Architecture {
self.family
}