ElixirLS Fails if Git Dependency Present (Visual Studio Code Extension)

Hello,

I have an issue with ElixirLS running in VSCode if a Git dependency is present. I tried to create a fresh project with a single git dependency, and immediately reproduced the problem. I am not sure how to debug this further, as the error message is very cryptic. Any help appreciated.

Below are the logs of a new elixir project, using latest Elixir version, and simply adding a single git dependency.


defmodule Alchemist.MixProject do
  use Mix.Project

  def project do
    [
      app: :alchemist,
      version: "0.1.0",
      elixir: "~> 1.17",
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

  # Run "mix help compile.app" to learn about applications.
  def application do
    [
      extra_applications: [:logger]
    ]
  end

  # Run "mix help deps" to learn about dependencies.
  defp deps do
    [
      {:jason, github: "michalmuskala/jason"}
    ]
  end
end

➜  alchemist git:(main) ✗ iex
Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] [dtrace]

Interactive Elixir (1.17.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> System.cmd("git", ["--git-dir=.git", "config", "remote.origin.url"], [cd: "/Users/mazyod/projects/new-elixir/alchemist/deps/jason"])
{"https://github.com/michalmuskala/jason.git\n", 0}

Running /Users/mazyod/.vscode/extensions/jakebecker.elixir-ls-0.22.1/elixir-ls-release/launch.sh
Preferred shell is zsh, relaunching
Looking for ASDF install
ASDF not found
Looking for mise executable
mise not found
Looking for rtx executable
rtx not found
Looking for vfox executable
vfox not found
Installing ElixirLS release v0.22.1
Running in /Users/mazyod/projects/new-elixir/alchemist
Install complete
[Info  - 9:02:37 AM] Started ElixirLS v0.22.1
[Info  - 9:02:37 AM] Running in /Users/mazyod/projects/new-elixir/alchemist
[Info  - 9:02:37 AM] ElixirLS built with elixir "1.17.2" on OTP "26"
[Info  - 9:02:37 AM] Running on elixir "1.17.2 (compiled with Erlang/OTP 26)" on OTP "26"
[Info  - 9:02:37 AM] Protocols are not consolidated
[Info  - 9:02:37 AM] Elixir sources not found (checking in /private/tmp/elixir-20240706-7373-erwccq/elixir-1.17.2). Code navigation to Elixir modules disabled.
[Info  - 9:02:37 AM] Received client configuration via workspace/configuration
%{"additionalWatchedExtensions" => [], "autoBuild" => true, "autoInsertRequiredAlias" => true, "dialyzerEnabled" => true, "dialyzerFormat" => "dialyxir_long", "dialyzerWarnOpts" => [], "enableTestLenses" => false, "envVariables" => %{"PATH" => "/opt/homebrew/bin"}, "fetchDeps" => false, "incrementalDialyzer" => true, "languageServerOverridePath" => "", "mixEnv" => "test", "mixTarget" => "", "projectDir" => "", "signatureAfterComplete" => true, "suggestSpecs" => true, "trace" => %{"server" => "off"}}
[Info  - 9:02:37 AM] Registering for workspace/didChangeConfiguration notifications
[Info  - 9:02:37 AM] Starting build with MIX_ENV: test MIX_TARGET: host
[Info  - 9:02:37 AM] client/registerCapability succeeded
[Info  - 9:02:37 AM] Registering for workspace/didChangeWatchedFiles notifications
[Info  - 9:02:37 AM] client/registerCapability succeeded
[Info  - 9:02:37 AM] Loaded DETS databases in 17ms
[Error - 9:02:37 AM] Process #PID<0.255.0> raised an exception
** (ErlangError) Erlang error: :enoent
    (elixir 1.17.2) lib/system.ex:1114: System.cmd("git", ["--git-dir=.git", "config", "remote.origin.url"], [cd: "/Users/mazyod/projects/new-elixir/alchemist/deps/jason"])
    (mix 1.17.2) lib/mix/scm/git.ex:312: Mix.SCM.Git.get_rev_info/0
    (mix 1.17.2) lib/mix/scm/git.ex:75: anonymous fn/2 in Mix.SCM.Git.lock_status/1
    (elixir 1.17.2) lib/file.ex:1665: File.cd!/2
    (mix 1.17.2) lib/mix/dep.ex:425: Mix.Dep.check_lock/1
    (elixir 1.17.2) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
    (mix 1.17.2) lib/mix/tasks/deps.loadpaths.ex:76: Mix.Tasks.Deps.Loadpaths.deps_check/2
    (mix 1.17.2) lib/mix/tasks/deps.loadpaths.ex:48: Mix.Tasks.Deps.Loadpaths.run/1
    (mix 1.17.2) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.17.2) lib/mix/tasks/loadpaths.ex:37: Mix.Tasks.Loadpaths.run/1
    (mix 1.17.2) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.17.2) lib/mix/tasks/compile.ex:153: Mix.Tasks.Compile.run/1
    (mix 1.17.2) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (language_server 0.22.1) lib/language_server/build.ex:442: ElixirLS.LanguageServer.Build.run_mix_compile/1
    (language_server 0.22.1) lib/language_server/build.ex:80: anonymous fn/3 in ElixirLS.LanguageServer.Build.build/3
    (stdlib 5.2.3) timer.erl:270: :timer.tc/2
Received $/cancelRequest for unknown request id: 8
Received $/cancelRequest for unknown request id: 11