feat: updated coyote installation scripts to detect when gnu is installable
This commit is contained in:
+1
-22
@@ -68,30 +68,9 @@ fn normalize_version(requested: Option<String>) -> Option<String> {
|
||||
}
|
||||
}
|
||||
|
||||
fn host_has_glibc() -> bool {
|
||||
if process::Command::new("getconf")
|
||||
.arg("GNU_LIBC_VERSION")
|
||||
.output()
|
||||
.is_ok_and(|out| out.status.success())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
process::Command::new("ldd")
|
||||
.arg("--version")
|
||||
.output()
|
||||
.is_ok_and(|out| {
|
||||
let combined = format!(
|
||||
"{}{}",
|
||||
String::from_utf8_lossy(&out.stdout),
|
||||
String::from_utf8_lossy(&out.stderr)
|
||||
);
|
||||
combined.to_lowercase().contains("glibc")
|
||||
})
|
||||
}
|
||||
|
||||
fn preferred_update_target() -> Option<&'static str> {
|
||||
match (env::consts::OS, env::consts::ARCH) {
|
||||
("linux", "x86_64") if host_has_glibc() => Some("x86_64-unknown-linux-gnu"),
|
||||
("linux", "x86_64") if cfg!(target_env = "gnu") => Some("x86_64-unknown-linux-gnu"),
|
||||
("linux", "x86_64") => Some("x86_64-unknown-linux-musl"),
|
||||
// No aarch64 gnu asset is published; musl is the only option.
|
||||
("linux", "aarch64") => Some("aarch64-unknown-linux-musl"),
|
||||
|
||||
Reference in New Issue
Block a user