Skip to content

Commit

Permalink
Simplify check for whether system is musl
Browse files Browse the repository at this point in the history
Now it runs `ldd --version` instead of `ldd ls`.
  • Loading branch information
autarch committed Dec 25, 2024
1 parent fd6255b commit 596802d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions ubi/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,11 @@ fn platform_is_musl(platform: &Platform) -> bool {
return false;
}

let Ok(ls) = which("ls") else {
return false;
};
let Ok(ldd) = which("ldd") else {
return false;
};

let Ok(output) = std::process::Command::new(ldd).arg(ls).output() else {
let Ok(output) = std::process::Command::new(ldd).arg("--version").output() else {
return false;
};
output.status.success() && String::from_utf8_lossy(&output.stdout).contains("musl")
Expand Down

0 comments on commit 596802d

Please sign in to comment.