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

Unable to run test with asdf and system elixir #16

Closed
fuelen opened this issue Jan 19, 2023 · 2 comments
Closed

Unable to run test with asdf and system elixir #16

fuelen opened this issue Jan 19, 2023 · 2 comments

Comments

@fuelen
Copy link

fuelen commented Jan 19, 2023

Hello

Thank you for this awesome adapter.
I'm trying to integrate it into my workflow and here is the error I've found.
Steps to reproduce:

  • install elixir, erlang and asdf
  • $ asdf global elixir system
    
  • $ asdf global erlang system
    
  • try to run some test using neotest plugin
  • the test is failed and output is the following
** (SyntaxError) /home/artur/.asdf/shims/mix:3:18: syntax error before: '.'
    |
  3 | exec /home/artur/.asdf/bin/asdf exec "mix" "$@" # asdf_allow: ' asdf '
    |                  ^
    (elixir 1.14.0) lib/code.ex:1245: Code.require_file/2

everything is OK if I specify elixir version from asdf and not the system one.

@jfpedroza
Copy link
Owner

Tests are run using elixir -S mix ... and not mix .... The first one executes elixir, which finds mix in path and executes it as an Elixir script. But with asdf, mix is a shell script, so it fails to compile.

Somehow, when you use a version from asdf, elixir resolves mix to the real script and not the shim, so it has no issues. I think this is a bug in asdf. You can even run elixir -S mix in a shell and see the same error.

Try opening an issue in the asdf-elixir repo.

@fuelen
Copy link
Author

fuelen commented Jan 26, 2023

Yes, you're right. I see there is a similar issue there which is currently open. I'll close this one for now.

@fuelen fuelen closed this as completed Jan 26, 2023
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