Skip to content

Commit

Permalink
fix: detect solus glibc (#821)
Browse files Browse the repository at this point in the history
Fixes #815
  • Loading branch information
baszalmstra authored Aug 16, 2024
1 parent 66567b8 commit 23907c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/rattler_virtual_packages/src/libc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn try_detect_libc_version() -> Result<Option<(String, Version)>, DetectLibCErro
#[cfg(any(test, unix))]
fn parse_glibc_ldd_version(input: &str) -> Result<Option<Version>, DetectLibCError> {
static GNU_LIBC_RE: once_cell::sync::Lazy<regex::Regex> = once_cell::sync::Lazy::new(|| {
regex::Regex::new("(?mi)(?:glibc|gentoo|gnu libc).*?([0-9]+(:?.[0-9]+)*)$").unwrap()
regex::Regex::new("(?mi)(?:glibc|gentoo|gnu libc|solus).*?([0-9]+(:?.[0-9]+)*)$").unwrap()
});

if let Some(version_match) = GNU_LIBC_RE
Expand Down Expand Up @@ -105,5 +105,9 @@ mod test {
parse_glibc_ldd_version("ldd (GNU libc) 2.31").unwrap(),
Some(Version::from_str("2.31").unwrap())
);
assert_eq!(
parse_glibc_ldd_version("ldd (Solus) 2.39").unwrap(),
Some(Version::from_str("2.39").unwrap())
);
}
}

0 comments on commit 23907c3

Please sign in to comment.