Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nextls doesn't start on NixOS #56

Open
elliottneilclark opened this issue Sep 22, 2023 · 1 comment
Open

nextls doesn't start on NixOS #56

elliottneilclark opened this issue Sep 22, 2023 · 1 comment

Comments

@elliottneilclark
Copy link

On a Linux machine configured with NixOS, dynamic loading is different. Because of this it's often not possible to simply download a binary that depends on libc and run it.

This manifests as vscode not starting the nextls binary

[Error - 11:51:56 AM] NextLS client: couldn't create connection to server.
Launching server using command /home/elliott/.cache/elixir-tools/nextls/bin/nextls failed. Error: spawn /home/elliott/.cache/elixir-tools/nextls/bin/nextls ENOENT

Nix provides a utility to change all the loads in place. That seems to get nextls running

steam-run ./nextls
Next LS v0.12.6

The language server for Elixir that just works.

     Author: Mitchell Hanberg
  Home page: https://www.elixir-tools.dev/next-ls
Source code: https://github.com/elixir-tools/next-ls

nextls [flags]

FLAGS

  --stdio             Use stdio as the transport mechanism
  --port <port>       Use TCP as the transport mechanism, with the given port
  --help              Show help
  --version           Show nextls version

It might be possible to detect that vscode is on Nixos and then run steam-run nextls in the extension.

Rust Analyzer also has a similar issue of needing a running process downloaded from the internet. They chose to solve this by having nixos fix up the binary.

https://github.com/rust-lang/rust-analyzer/blob/2b580a1f3c7bf7f2dd6d1462282362b80a6a3d91/editors/code/src/bootstrap.ts#L100C1-L144C2

@alissonfpmorais
Copy link

I'm having the same problem here, also I didn't knew about steam-run. Did you managed to get the extension working with it?

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

No branches or pull requests

2 participants