Skip to content

feat: Add support for Alma Linux#60

Merged
HighCommander4 merged 4 commits intoclangd:masterfrom
mancasg:patch-1
Feb 9, 2026
Merged

feat: Add support for Alma Linux#60
HighCommander4 merged 4 commits intoclangd:masterfrom
mancasg:patch-1

Conversation

@mancasg
Copy link
Copy Markdown
Contributor

@mancasg mancasg commented Feb 6, 2026

Greetings,

The ldd that comes with this distro has the following version string:

$ ldd --version
ldd (GNU libc) 2.39
...

I caught this while using the [neo]vim coc-clangd extension, which errored with:

[extension:coc-clangd] - Can't glibc version from ldd --version output: ldd (GNU libc) 2.39

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to tweak the case sensitivity, the change is making us fail this test case

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used a capturing group 🤦‍♂️ . Fixed now

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, the [e] here was deliberate, it's a reference to https://github.com/Xilinx/eglibc, please keep it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The irony is that just earlier I referenced Chesterton's fence

@HighCommander4 HighCommander4 merged commit d58767c into clangd:master Feb 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants