ElixirLS Fork stopped working on Windows

I’m getting:

an exception was raised:
    ** (Mix.Error) Could not compile dependency :gpb, "escript.exe "c:/Users/jbn/.mix/rebar" compile skip_deps=true deps_dir="c:/Users/jbn/client-work/bzzt/taxi-backend/.elixir_ls/build/test/lib"" command failed. You can recompile this dependency with "mix deps.compile gpb", update it with "mix deps.update gpb" or clean it with "mix deps.clean gpb"
        (mix) lib/mix.ex:375: Mix.raise/1
        (elixir) lib/file.ex:1506: File.cd!/2
        (mix) lib/mix/tasks/deps.compile.ex:265: Mix.Tasks.Deps.Compile.do_command/5
        (mix) lib/mix/tasks/deps.compile.ex:80: anonymous fn/4 in Mix.Tasks.Deps.Compile.compile/2
        (elixir) lib/enum.ex:1327: Enum."-map/2-lists^map/1-0-"/2
        (mix) lib/mix/tasks/deps.compile.ex:64: Mix.Tasks.Deps.Compile.compile/2
        (mix) lib/mix/tasks/deps.loadpaths.ex:89: Mix.Tasks.Deps.Loadpaths.deps_check/2
        (mix) lib/mix/tasks/deps.loadpaths.ex:28: Mix.Tasks.Deps.Loadpaths.run/1

This started happening after I screwed up my mix.lock file for a bit. And then I fixed it for my normal mix commands, it all works and runs. But ElixirLS (the fork) gets hung up and Output shows me:

Started ElixirLS Fork v0.3.0
Elixir version: "1.8.2 (compiled with Erlang/OTP 20)"
Erlang version: "21"
Compiling with Mix env test
==> gpb (compile)
'sh' is not recognized as an internal or external command,
operable program or batch file.
ERROR: Command [compile] failed!

I’ve tried running the command manually but it doesn’t have the error so I imagine there are environment differences.
I’ve tried reinstalling the ElixirLS Fork extension in case that would help with some cruft.
I’ve tried removing the .elixir_ls folder so it could be recreated.

It hasn’t helped.

Ok, this seems related: https://github.com/bitwalker/exprotobuf/issues/39

So if this means that elixir ls has decided to build using cmd.exe, did that change somehow? Fairly confusing.

I haven’t really solved the deeper issue but since elixir ls builds stuff based on the test environment I made sure that MIX_ENV=test mix deps.compile gpb worked and then I could just cp -r _build/test/lib/gpb .elixir_ls/build/test/lib/gpb which seems to work fine.

Things are back to working.

Maybe this PR is related? https://github.com/elixir-lsp/elixir-ls/pull/118
Although windows should be using the .bat instead of .sh script

I think it might be on the gpb end of things honestly. But there is definitely some kerfuffle between cmd.exe and the git version of bash.

1 Like