williamboman / nvim-lsp-installer

Further development has moved to https://github.com/williamboman/mason.nvim!
https://github.com/williamboman/mason.nvim
Apache License 2.0
2k stars 123 forks source link

clangd is installed with requirement for newer glibc than existing clangd on system #526

Open Chaz6 opened 2 years ago

Chaz6 commented 2 years ago

Problem description

When installing support for clangd, instead of using the system clangd, a new clangd installation is downloaded which requires a newer libc than is available on the system, so attempting to use it will fail. I was able to workaround this by deleting the folder ~/.local/share/nvim/lsp_servers/clangd/clangd then restarting neovim. Please note the contents of LspInfo are shown after implementing the workaround.

Neovim version (>= 0.6)

NVIM v0.7.0-dev+1192-g8ed9c8448 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3

Operating system/version

Centos 7.9.2009 (Core)

I've recently downloaded the latest plugin version of both nvim-lsp-installer and nvim-lspconfig

Affected language servers

clangd

Steps to reproduce

  1. Install clangd using :LspInstallInfo
  2. Open a *.c file and attempt to use the clangd lsp.

Actual behavior

[ERROR][2022-03-06 15:57:57] .../vim/lsp/rpc.lua:420 "rpc" "clangd" "stderr" "clangd: /lib64/libc.so.6: versionGLIBC_2.18' not found (required by clangd)\n"`

Expected behavior

If clangd is already available on the system, the installer should use that instead of downloading a fresh copy that is broken on the system.

LspInfo

Language client log: /home/chaz/.cache/nvim/lsp.log
Detected filetype:   c
0 client(s) attached to this buffer:

Client: clangd (id: 1, pid: 22041, bufnr: [1])
c, cpp, objc, objcpp
autostart:       true
root directory:  /home/chaz/git/github.com_weechat_weechat
cmd:             clangd

Healthcheck

nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
  - OK: neovim version >= 0.6.0
  - WARNING: **julia**: not available
  - OK: **bash**: `GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)`
  - OK: **tar**: `tar (GNU tar) 1.26`
  - OK: **gzip**: `gzip 1.5`
  - OK: **curl**: `curl 7.79.0-DEV (Linux) libcurl/7.79.0-DEV OpenSSL/1.1.1k zlib/1.2.7 libssh2/1.8.0`
  - OK: **wget**: `GNU Wget 1.14 built on linux-gnu.`
  - OK: **python3**: `Python 3.9.7`
  - OK: **node**: `v16.0.0`
  - OK: **Ruby**: `ruby 2.0.0p648 (2015-12-16) [x86_64-linux]`
  - WARNING: **Go**: unsupported version `go version go1.16.1 linux/amd64`. Go version must be >= 1.17.
  - OK: **sh**: `Ok`
  - OK: **npm**: `7.21.0`
  - OK: **RubyGem**: `2.0.14.1`
  - OK: **java**: `Ok`
  - OK: **PHP**: `PHP 7.4.28 (cli) (built: Feb 21 2022 20:03:21) ( NTS )`
  - OK: **Composer**: `Composer version 2.1.1 2021-06-04 08:46:46`
  - OK: **javac**: `Ok`
  - OK: **pip3**: `pip 22.0.3 from /home/chaz/.local/lib/python3.9/site-packages/pip (python 3.9)`

Screenshots or recordings

No response

williamboman commented 2 years ago

I found this: https://github.com/clangd/clangd/issues/722#issuecomment-795295250. This doesn't seem like anything that can be fixed here - maybe there could be a check for which glibc version is installed to make sure it's >= 2.18.

If clangd is already available on the system, the installer should use that instead of downloading a fresh copy that is broken on the system.

I'd recommend simply not managing clangd via nvim-lsp-installer instead. You :LspUninstall clangd and then make sure you set up clangd directly via lspconfig somewhere in your config:

lspconfig.clangd.setup {}