Skip to content

Commit

Permalink
fix(cli): build script panics on musl due to glibc_version check
Browse files Browse the repository at this point in the history
  • Loading branch information
jirutka and 12101111 committed Jul 23, 2023
1 parent 60d3c4c commit 9393b83
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,13 @@ fn main() {

#[cfg(target_os = "linux")]
{
let ver = glibc_version::get_version().unwrap();

// If a custom compiler is set, the glibc version is not reliable.
// Here, we assume that if a custom compiler is used, that it will be modern enough to support a dynamic symbol list.
if env::var("CC").is_err() && ver.major <= 2 && ver.minor < 35 {
if env::var("CC").is_err()
&& glibc_version::get_version()
.map(|ver| ver.major <= 2 && ver.minor < 35)
.unwrap_or(false)
{
println!("cargo:warning=Compiling with all symbols exported, this will result in a larger binary. Please use glibc 2.35 or later for an optimised build.");
println!("cargo:rustc-link-arg-bin=deno=-rdynamic");
} else {
Expand Down

0 comments on commit 9393b83

Please sign in to comment.