fix: Prefer GNU linux builds in install scripts for duckdb support, and gate duckdb support on linux hosts that are MUSL until MUSL support is added

This commit is contained in:
2026-08-28 20:06:39 -06:00
parent 50d2a74e80
commit 18c2cfeb41
4 changed files with 56 additions and 2 deletions
+23
View File
@@ -68,9 +68,32 @@ 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") => Some("x86_64-unknown-linux-musl"),
// No aarch64 gnu asset is published; musl is the only option.
("linux", "aarch64") => Some("aarch64-unknown-linux-musl"),
_ => None,
}