tonini / alchemist.el

Elixir Tooling Integration Into Emacs
http://www.alchemist-elixir.org
906 stars 103 forks source link

Running alchemist test uses /usr/local/bin/elixir #282

Closed gjaldon closed 7 years ago

gjaldon commented 7 years ago

I'm using spacemacs and every time I do SPC m a t, it fails with an error related to using an older version of Elixir in my system which is at /usr/local/bin/elixir. Below is the error I get:

=INFO REPORT==== 18-Jan-2017::17:21:20 ===
    application: logger
    exited: {{shutdown,{failed_to_start_child,'Elixir.GenEvent',undef}},
             {'Elixir.Logger.App',start,[normal,[]]}}
    type: temporary
** (Mix.Config.LoadError) could not load config config/config.exs
    ** (ArgumentError) argument error
    (stdlib) erl_anno.erl:318: :erl_anno.set(:file, 'nofile', -1)
    (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2
    (stdlib) erl_parse.yrl:1635: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1641: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1632: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1637: :erl_parse.modify_anno1/3

I use asdf version management of Elixir and the version that's set for my project is Elixir 1.4. When using alchemist-help, I get the docs for Elixir 1.4. I tried setting certain config variables to point to the correct Elixir version:

alchemist-mix-command "~/.asdf/installs/elixir/1.4.0/bin/mix"
alchemist-iex-program-name "~/.asdf/installs/elixir/1.4.0/bin/iex"
alchemist-execute-command "~/.asdf/installs/elixir/1.4.0/bin/elixir"
alchemist-compile-command "~/.asdf/install/elixir/1.4.0/elixirc"

The alchemist-test still uses the Elixir 1.1 at /usr/local/bin/elixir. Let me know if there's any more info you need.

tonini commented 7 years ago

Hi @gjaldon

Thanks for reporting this one. I had a quick look and I found the issue in the alchemist mix library which called mix directly instead through the mix command custom variable.

The fix is already on master: https://github.com/tonini/alchemist.el/commit/20a0c043b5df66ee1f731e1ffe53d5697915b626

gjaldon commented 7 years ago

Hi @tonini. Thanks for the quick response and fix! Just tested it out and it works. 💜