mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Add Windows x86-32 emulation support to interpreter architecture checks
This commit is contained in:
parent
483b4c82e8
commit
916c27e5bd
1 changed files with 24 additions and 8 deletions
|
@ -142,14 +142,30 @@ impl Arch {
|
||||||
|
|
||||||
// TODO: Implement `variant` support checks
|
// TODO: Implement `variant` support checks
|
||||||
|
|
||||||
// Windows ARM64 runs emulated x86_64 binaries transparently
|
if cfg!(windows) {
|
||||||
// Similarly, macOS aarch64 runs emulated x86_64 binaries transparently if you have Rosetta
|
match (self.family, other.family) {
|
||||||
// installed. We don't try to be clever and check if that's the case here, we just assume
|
// Windows aarch64 runs emulated x86_64 binaries transparently
|
||||||
// that if x86_64 distributions are available, they're usable.
|
(
|
||||||
if (cfg!(windows) || cfg!(target_os = "macos"))
|
target_lexicon::Architecture::Aarch64(_),
|
||||||
&& matches!(self.family, target_lexicon::Architecture::Aarch64(_))
|
target_lexicon::Architecture::X86_64,
|
||||||
{
|
)
|
||||||
return other.family == target_lexicon::Architecture::X86_64;
|
// Windows x86_64 runs emulated x86_32 binaries transparently
|
||||||
|
| (target_lexicon::Architecture::X86_64, target_lexicon::Architecture::X86_32(_)) => {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
} else if cfg!(target_os = "macos") {
|
||||||
|
match (self.family, other.family) {
|
||||||
|
// macOS aarch64 runs emulated x86_64 binaries transparently if you have Rosetta
|
||||||
|
// installed. We don't try to be clever and check if that's the case here, we just assume
|
||||||
|
// that if x86_64 distributions are available, they're usable.
|
||||||
|
(
|
||||||
|
target_lexicon::Architecture::Aarch64(_),
|
||||||
|
target_lexicon::Architecture::X86_64,
|
||||||
|
) => return true,
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
false
|
false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue