Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ serde = { version = "1.0.197", features = ["derive"] }
serde_json = { version = "1.0.114" }
sha2 = { version = "0.10.8" }
sys-info = { version = "0.9.1" }
target-lexicon = {version = "0.12.14" }
tempfile = { version = "3.9.0" }
textwrap = { version = "0.16.1" }
thiserror = { version = "1.0.56" }
Expand Down
1 change: 1 addition & 0 deletions crates/uv-toolchain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ same-file = { workspace = true }
schemars = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
target-lexicon = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
tokio-util = { workspace = true, features = ["compat"] }
Expand Down
17 changes: 11 additions & 6 deletions crates/uv-toolchain/src/platform.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use std::{
fmt::{self},
str::FromStr,
};
use std::{fmt, str::FromStr};
use thiserror::Error;

/// All supported operating systems.
Expand Down Expand Up @@ -130,10 +127,18 @@ impl Arch {

impl Libc {
pub(crate) fn from_env() -> Self {
// TODO(zanieb): Perform this lookup
match std::env::consts::OS {
// Supported platforms.
"linux" => Libc::Gnu,
"linux" => {
let environment = target_lexicon::HOST.environment.into_str();
if environment.starts_with("gnu") || environment == "linuxkernel" {
Libc::Gnu
} else if environment.starts_with("musl") {
Libc::Musl
} else {
Libc::None
}
}
"windows" | "macos" => Libc::None,
// Platforms without explicit support.
_ => Libc::None,
Expand Down