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

Indexing project fails because rebar3 is not included in bundled Elixir #451

Closed
cschmatzler opened this issue May 8, 2024 · 6 comments · Fixed by #452 or #453
Closed

Indexing project fails because rebar3 is not included in bundled Elixir #451

cschmatzler opened this issue May 8, 2024 · 6 comments · Fixed by #452 or #453

Comments

@cschmatzler
Copy link

Fresh install of 0.21.1 using elixir-tools.nvim, I don't get any completions or symbols for my project because indexing fails.
The log shows the following:

23:25:05.192 [debug] sent notification server -> client window/logMessage

23:25:05.192 [info] Shall I install rebar3? (if running non-interactively, use "mix local.rebar --force") [Yn] 

23:25:05.197 [debug] sent notification server -> client $/progress

23:25:05.197 [debug] sent notification server -> client window/logMessage

23:25:05.197 [warning] Unexpected compiler response: {:error, %{message: "Could not find \"rebar3\" to compile dependency :poolboy, please ensure \"rebar3\" is available", __struct__: Mix.Error, __exception__: true, mix: 1}}

Since the runtime is now bundled with next-ls, I don't know how I can install rebar myself. All dependencies work locally using Elixir 1.16.2, OTP 26.2.4 both installed using mise.

@mhanberg
Copy link
Collaborator

mhanberg commented May 8, 2024

Can you delete this directory ~/.cache/elixir-tools/nextls/elixir and then restart?

I think maybe something went wrong where it unarchived the bundle but failed before installing rebar and hex.

@mhanberg
Copy link
Collaborator

mhanberg commented May 9, 2024

Actually I think #452 will fix it.

if you can, can you try and build it locally and try (you'll need to first do ./burrito_out/next_ls_<os>_<arch> maintenance uninstall and then set the cmd field in the setup in elixir-tools.nvim to point to the binary for your OS

you'll need zig installed tho, but mise should install it

BURRITO_TARGET=linux_amd64 MIX_ENV=prod mix release --overwrite

you can see the valid burrito targets for your machine in mix.exs (or else it will build all of them)

or i can release the linked patch and you update and see if it works

@mhanberg
Copy link
Collaborator

mhanberg commented May 9, 2024

OK, update when you can and tell me if it solves your problem

@cschmatzler
Copy link
Author

Hey, sorry I couldn’t test it before you cut a release, time zones and stuff meant I was snoring away.
Can confirm that 0.21.2 fixes the issue and my project gets indexed now. Thanks so much!

@timfjord
Copy link

It looks like the issue is still present in 0.23.2

[Next LS] NextLS v0.23.2 has initialized!
[Next LS] [extension] Credo initializing with options %NextLS.InitOpts.Extensions.Credo{enable: true, cli_options: []}
[Next LS] Booting runtimes...
[Next LS] Beginning DB migration...
[Next LS] Database is on the latest version: 7
[Next LS] Finished DB migration...
[Next LS] Booting runtime for .

...

Environment: 

LSP=nextls
NEXTLS_PARENT_PID=g1h3K25leHQtbHMtMTcyNDkxODQ2NzI4ODMxMzI1MEBNYWNCb29rLVByby1UaW0AAAEHAAAAAGbQKsQ=
MIX_ENV=dev
MIX_TARGET=host
MIX_BUILD_ROOT=.elixir-tools/_build
ROOTDIR=false
BINDIR=false
RELEASE_ROOT=false
RELEASE_SYS_CONFIG=false
PATH=<...>
[Next LS] Connected to node nextls-runtime-1724918468870896042@MacBook-Pro-Tim
[Next LS] Runtime for folder  is ready...
[Next LS] Could not find "rebar3", which is needed to build dependency :unicode_util_compat
[Next LS] Shall I install rebar3? (if running non-interactively, use "mix local.rebar --force") [Yn]
[Next LS] Unexpected compiler response: {:error, %{message: "Could not find \"rebar3\" to compile dependency :unicode_util_compat, please ensure \"rebar3\" is available", __struct__: Mix.Error, __exception__: true, mix: 1}}

@timfjord
Copy link

Removing the .elixir-tools and _build folders and restarting the server/editor has fixed the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment