feat: Add support for Alma Linux#60
Conversation
The ldd that comes with this distro has the following version string: ``` $ ldd --version ldd (GNU libc) 2.39 ```
src/index.ts
Outdated
| // Require some confirmation this is [[e]g]libc, and a plausible | ||
| // version number. | ||
| const match = line.match(/^ldd .*glibc.* (\d+(?:\.\d+)+)[^ ]*$/i); | ||
| const match = line.match(/^ldd .*libc.* (\d+(?:\.\d+)+)[^ ]*$/i); |
There was a problem hiding this comment.
Might this produce a false positive match for non-glibc C library implementations, such as llvm-libc?
It might be safer to do something like [GNU |g]libc
There was a problem hiding this comment.
Indeed, that was a bit hasty on my part. It failed to match "GNU libc" versions.
I checked the new version against a couple of versions using docker. The musl one fails as expected.
=== ubuntu:latest ===
ldd (Ubuntu GLIBC 2.39-0ubuntu8.6) 2.39
=== ubuntu:22.04 ===
ldd (Ubuntu GLIBC 2.35-0ubuntu3.11) 2.35
=== ubuntu:20.04 ===
ldd (Ubuntu GLIBC 2.31-0ubuntu9.17) 2.31
=== debian:latest ===
ldd (Debian GLIBC 2.41-12+deb13u1) 2.41
=== fedora:latest ===
ldd (GNU libc) 2.42
=== almalinux:9 ===
ldd (GNU libc) 2.34
=== almalinux:8 ===
ldd (GNU libc) 2.28
=== rockylinux:9 ===
ldd (GNU libc) 2.34
=== amazonlinux:2023 ===
ldd (GNU libc) 2.34
=== archlinux:latest ===
ldd (GNU libc) 2.42
=== alpine:latest ===
musl libc (x86_64)
src/index.ts
Outdated
| const match = line.match(/^ldd .*glibc.* (\d+(?:\.\d+)+)[^ ]*$/i); | ||
| const match = line.match(/^ldd .*libc.* (\d+(?:\.\d+)+)[^ ]*$/i); | ||
| if (!match || !semver.validRange(match[1], loose)) { | ||
| console.error(`Can't glibc version from ldd --version output: ${line}`); |
There was a problem hiding this comment.
(Also, while you're editing this code anyways, could you correct the wording of this please, to "Can't determine glibc version from..."?)
And also, the mismatch error message.
src/index.ts
Outdated
| // Require some confirmation this is glibc, and a plausible | ||
| // version number. | ||
| const match = line.match(/^ldd .*glibc.* (\d+(?:\.\d+)+)[^ ]*$/i); | ||
| const match = line.match(/^ldd .*(GNU |g)libc.* (\d+(?:\.\d+)+)[^ ]*$/i); |
There was a problem hiding this comment.
We need to tweak the case sensitivity, the change is making us fail this test case
There was a problem hiding this comment.
I used a capturing group 🤦♂️ . Fixed now
There was a problem hiding this comment.
Ah, I see. TIL what the /i at the end of a regex means in JS :)
| const output = await run(lddCommand, ['--version']); | ||
| // The first line is e.g. "ldd (Debian GLIBC 2.29-9) 2.29". | ||
| const line = output.split('\n', 1)[0]; | ||
| // Require some confirmation this is [e]glibc, and a plausible |
There was a problem hiding this comment.
By the way, the [e] here was deliberate, it's a reference to https://github.com/Xilinx/eglibc, please keep it
There was a problem hiding this comment.
The irony is that just earlier I referenced Chesterton's fence
Greetings,
The ldd that comes with this distro has the following version string:
I caught this while using the [neo]vim coc-clangd extension, which errored with: