mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-01 14:31:12 +00:00
Ignore libc on other platforms (#3825)
Libc variants are only relevant on linux, we can ignore it on non {linux, windows, mac}, e.g. BSDs. Closes #3824
This commit is contained in:
parent
c2931e806d
commit
f4533c3a85
3 changed files with 9 additions and 7 deletions
|
@ -125,7 +125,7 @@ impl PythonDownloadRequest {
|
|||
self.os = Some(Os::from_env()?);
|
||||
}
|
||||
if self.libc.is_none() {
|
||||
self.libc = Some(Libc::from_env()?);
|
||||
self.libc = Some(Libc::from_env());
|
||||
}
|
||||
Ok(self)
|
||||
}
|
||||
|
|
|
@ -169,6 +169,6 @@ pub fn toolchains_for_version(version: &PythonVersion) -> Result<Vec<Toolchain>,
|
|||
fn platform_key_from_env() -> Result<String, Error> {
|
||||
let os = Os::from_env()?;
|
||||
let arch = Arch::from_env()?;
|
||||
let libc = Libc::from_env()?;
|
||||
let libc = Libc::from_env();
|
||||
Ok(format!("{os}-{arch}-{libc}").to_lowercase())
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ impl Platform {
|
|||
Ok(Self::new(
|
||||
Os::from_env()?,
|
||||
Arch::from_env()?,
|
||||
Libc::from_env()?,
|
||||
Libc::from_env(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
@ -149,12 +149,14 @@ impl Arch {
|
|||
}
|
||||
|
||||
impl Libc {
|
||||
pub(crate) fn from_env() -> Result<Self, Error> {
|
||||
pub(crate) fn from_env() -> Self {
|
||||
// TODO(zanieb): Perform this lookup
|
||||
match std::env::consts::OS {
|
||||
"linux" => Ok(Libc::Gnu),
|
||||
"windows" | "macos" => Ok(Libc::None),
|
||||
_ => Err(Error::LibcNotDetected()),
|
||||
// Supported platforms.
|
||||
"linux" => Libc::Gnu,
|
||||
"windows" | "macos" => Libc::None,
|
||||
// Platforms without explicit support.
|
||||
_ => Libc::None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue