Skip to content

Commit d58767c

Browse files
authored
Get ldd version detection to work on Alma Linux (#60)
The ldd that comes with this distro has the following version string: ``` $ ldd --version ldd (GNU libc) 2.39 ``` and we were previously expecting `glibc`. Non-GNU libc (e.g. musl) continues to fail the recognition check.
1 parent fefeabf commit d58767c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,11 @@ namespace Version {
439439
const line = output.split('\n', 1)[0];
440440
// Require some confirmation this is [e]glibc, and a plausible
441441
// version number.
442-
const match = line.match(/^ldd .*glibc.* (\d+(?:\.\d+)+)[^ ]*$/i);
442+
const match = line.match(/^ldd .*(?:GNU |g)libc.* (\d+(?:\.\d+)+)[^ ]*$/i);
443443
if (!match || !semver.validRange(match[1], loose)) {
444-
console.error(`Can't glibc version from ldd --version output: ${line}`);
444+
console.error(
445+
`Can't determine glibc version from ldd --version output: ${line}`,
446+
);
445447
return null;
446448
}
447449
const version = new semver.Range(match[1], loose);

0 commit comments

Comments
 (0)