kabouzeid / nvim-lspinstall

Provides the missing :LspInstall for nvim-lspconfig
MIT License
526 stars 67 forks source link

SIGABRT when trying to install or uninstall lua #39

Open jc00ke opened 3 years ago

jc00ke commented 3 years ago

image

image

❯ nvim --version
NVIM v0.5.0-dev+1265-g66f9dd3c6
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az36-146

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info

Trying it out on 4257e3f. I did notice that the installation failed. Here's the output of :LspInfo

image

kabouzeid commented 3 years ago

Which OS are you on? I'm asking because there are problems with the neovim nightlies from Fedora and OpenSUSE.

jc00ke commented 3 years ago

Ubuntu 20.10 (Regolith Linux)

masmirnoff commented 3 years ago

Same problem when trying to install or uninstall any language server. ❯ nvim --version NVIM v0.5.0-dev+1281-gecf075eb2 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include Compiled by runner@fv-az205-437

Features: +acl +iconv +tui

ArchLinux

❯ uname -a Linux skynet 5.11.16-arch1-1 #1 SMP PREEMPT Wed, 21 Apr 2021 17:22:13 +0000 x86_64 GNU/Linux Screenshot_20210427_201108

masmirnoff commented 3 years ago

I found that the error occurs when executing this line of code from the lspinstall.lua file vim.fn.termopen("set -e\n" .. servers[lang].install_script, {["cwd"] = path, ["on_exit"] = onExit}) At the same time, if I set the installation script (identical to content of servers[lang].install_script) explicitly vim.fn.termopen("set -e\npython3 -m venv ./venv\n./venv/bin/pip3 install -U pip\n./venv/bin/pip3 install -U cmake-language-server", {["cwd"] = path, ["on_exit"] = onExit}) the error does not occur and the installation proceeds normally

masmirnoff commented 3 years ago

It turned out that neovim now wants the lines of the script for the termopen function to be formed this way

install_script = [[python3 -m venv ./venv
  ./venv/bin/pip3 install -U pip
  ./venv/bin/pip3 install -U cmake-language-server]]

and not this way

install_script = [[
  python3 -m venv ./venv
  ./venv/bin/pip3 install -U pip
  ./venv/bin/pip3 install -U cmake-language-server
]]
kabouzeid commented 3 years ago

Weird, it does work with my neovim (latest nightly) :/

WhoIsSethDaniel commented 3 years ago

@kabouzeid I typically install four LSP servers: go, bash, vim, lua. Recently I was unable to install any of these servers due to the SIGABRT. Using the fix suggested by @masmirnoff I was able to install gopls, but not the other servers (example below of what I changed).

e.g., for go, I changed:

install_script = [[
  GOPATH=$(pwd) GOBIN=$(pwd) GO111MODULE=on go get -v golang.org/x/tools/gopls
  GOPATH=$(pwd) GO111MODULE=on go clean -modcache
]]

to

install_script = [[GOPATH=$(pwd) GOBIN=$(pwd) GO111MODULE=on go get -v golang.org/x/tools/gopls
  GOPATH=$(pwd) GO111MODULE=on go clean -modcache]]

For bash I changed:

install_script = [[
  ! test -f package.json && npm init -y --scope=lspinstall || true
  npm install bash-language-server@latest
]]

to

install_script = [[! test -f package.json && npm init -y --scope=lspinstall || true
  npm install bash-language-server@latest]]

With similar changes for lua and vim.

$ nvim --version
NVIM v0.5.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-7UK5qc/neovim-0.5.0+ubuntu2+git202105040113-3fc71ea22-d569569c9=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-7UK5qc/neovim-0.5.0+ubuntu2+git202105040113-3fc71ea22-d569569c9/build/config -I/build/neovim-7UK5qc/neovim-0.5.0+ubuntu2+git202105040113-3fc71ea22-d569569c9/src -I/build/neovim-7UK5qc/neovim-0.5.0+ubuntu2+git202105040113-3fc71ea22-d569569c9/.deps/usr/include -I/usr/include -I/build/neovim-7UK5qc/neovim-0.5.0+ubuntu2+git202105040113-3fc71ea22-d569569c9/build/src/nvim/auto -I/build/neovim-7UK5qc/neovim-0.5.0+ubuntu2+git202105040113-3fc71ea22-d569569c9/build/include
Compiled by buildd@lcy01-amd64-029

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
git version at HEAD
nvim-lspinstall 471603f786c6b2aa9f667da99fc3dfef43de3e12
WhoIsSethDaniel commented 3 years ago

I was eventually able to install bash,vim,lua by fiddling with the install_script strings for each. I can find no common element that works, though.

For Lua I got rid of any empty lines:

  install_script = [[os=$(uname -s | tr "[:upper:]" "[:lower:]")
  case $os in
  linux)
  platform="Linux"
  ;;
  darwin)
  platform="macOS"
  ;;
  esac
  curl -L -o sumneko-lua.vsix $(curl -s https://api.github.com/repos/sumneko/vscode-lua/releases/latest | grep 'browser_' | cut -d\" -f4)
  rm -rf sumneko-lua
  unzip sumneko-lua.vsix -d sumneko-lua
  rm sumneko-lua.vsix
  chmod +x sumneko-lua/extension/server/bin/$platform/lua-language-server
  echo "#!/usr/bin/env bash" > sumneko-lua-language-server
  echo "\$(dirname \$0)/sumneko-lua/extension/server/bin/$platform/lua-language-server -E -e LANG=en \$(dirname \$0)/sumneko-lua/extension/server/main.lua \$*" >> sumneko-lua-language-server
  chmod +x sumneko-lua-language-server]]

For bash and vim I removed the first line, e.g.:

  install_script = [[npm install bash-language-server@latest]]
petertriho commented 3 years ago

Also getting similar issues when I tried to uninstall

Uninstall typescript language server?
nvim: /build/neovim-VmuHfa/neovim-0.5.0+ubuntu2+git202105151735-d67dcaba0-d569569c9/src/nvim/ui_compositor.c:556: ui_comp_raw_line: Assertion `attrs[i] >= 0' failed.

fish: Job 1, 'nvim  $argv' terminated by signal SIGABRT (Abort)
kabouzeid commented 3 years ago

@petertriho which OS?

petertriho commented 3 years ago

neovim nightly v0.5.0 on Ubuntu 20.04.2 LTS (on WSL2)

❯ nvim --version
NVIM v0.5.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-VmuHfa/neovim-0.5.0+ubuntu2+git202105151735-d67dcaba0-d569569c9=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-VmuHfa/neovim-0.5.0+ubuntu2+git202105151735-d67dcaba0-d569569c9/build/config -I/build/neovim-VmuHfa/neovim-0.5.0+ubuntu2+git202105151735-d67dcaba0-d569569c9/src -I/build/neovim-VmuHfa/neovim-0.5.0+ubuntu2+git202105151735-d67dcaba0-d569569c9/.deps/usr/include -I/usr/include -I/build/neovim-VmuHfa/neovim-0.5.0+ubuntu2+git202105151735-d67dcaba0-d569569c9/build/src/nvim/auto -I/build/neovim-VmuHfa/neovim-0.5.0+ubuntu2+git202105151735-d67dcaba0-d569569c9/build/include
Compiled by buildd@lgw01-amd64-055

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

~
❯ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal
NICHTJ3 commented 3 years ago

This was caused by lualine for me so I just switched to Galaxyline

kabouzeid commented 3 years ago

lualine works fine

petertriho commented 3 years ago

Removing lualine fixed the issue for me as well

NICHTJ3 commented 3 years ago

Lualine worked fine for me on Mac os but not on Ubuntu :shrug:

petertriho commented 3 years ago

Just switch to feline and I'm getting the same issues. It works fine every time I have feline or lualine disabled

EDIT: I've solved my issues by disabling the status lines for terminal buffertypes

NICHTJ3 commented 3 years ago

Should we close this issue as it kind of appears unrelated to this plugin?

ellisonleao commented 2 years ago

Still having this issue on nvim stable. bummer :(

> uname -a

Linux pilgrim 5.11.0-7633-generic #35~1630100930~20.04~ae2753e-Ubuntu SMP Mon Aug 30 18:23:52 UTC  x86_64 x86_64 x86_64 GNU/Linux
petertriho commented 2 years ago

Are you using any kind of statusline plugins?

ellisonleao commented 2 years ago

@petertriho the issue is with https://github.com/hoob3rt/lualine.nvim . If we disable it, the install script should work fine. But it still a bug right?