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

bug testing a simple example: discover elixir if possible #4

Closed
benoitc opened this issue Aug 14, 2016 · 2 comments
Closed

bug testing a simple example: discover elixir if possible #4

benoitc opened this issue Aug 14, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@benoitc
Copy link
Member

benoitc commented Aug 14, 2016

I was unable to compile a simple test:

Steps to reproduce:

  1. Create an app: rebar3 new app testapp
  2. edit the file rebar.config in the testapp folder:
{erl_opts, [debug_info]}.

{plugins, [{rebar3_elixir, {git, "git@github.com:barrel-db/rebar3_elixir.git", {branch, "master"}}}]}.


{deps, [{httpoison, {elixir, httpoison, "0.9.0"}}]}.
  1. run rebar3 compile

You get the following trace when runn

===> Fetching httpoison ({elixir,httpoison,"0.9.0"})
===> Adding Dir "/tmp/.tmp_dir710327170900"
Dependency httpoison already exists

===> rebar_fetch exception error {badmatch,false} [{rebar3_elixir_util,
                                                           get_details,1,
                                                           [{file,
                                                             "/private/tmp/testapp/_build/default/plugins/rebar3_elixir/src/rebar3_elixir_util.erl"},
                                                            {line,14}]},
                                                          {rebar3_elixir_util,
                                                           add_elixir,1,
                                                           [{file,
                                                             "/private/tmp/testapp/_build/default/plugins/rebar3_elixir/src/rebar3_elixir_util.erl"},
                                                            {line,6}]},
                                                          {rebar3_elixir_resource,
                                                           fetch_and_compile,
                                                           3,
                                                           [{file,
                                                             "/private/tmp/testapp/_build/default/plugins/rebar3_elixir/src/rebar3_elixir_resource.erl"},
                                                            {line,34}]},
                                                          {rebar3_elixir_resource,
                                                           download,3,
                                                           [{file,
                                                             "/private/tmp/testapp/_build/default/plugins/rebar3_elixir/src/rebar3_elixir_resource.erl"},
                                                            {line,16}]},
                                                          {rebar_fetch,
                                                           download_source_,3,
                                                           [{file,
                                                             "/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_fetch.erl"},
                                                            {line,45}]},
                                                          {rebar_fetch,
                                                           download_source,3,
                                                           [{file,
                                                             "/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_fetch.erl"},
                                                            {line,29}]},
                                                          {rebar_prv_install_deps,
                                                           fetch_app,3,
                                                           [{file,
                                                             "/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_install_deps.erl"},
                                                            {line,357}]},
                                                          {rebar_prv_install_deps,
                                                           maybe_fetch,5,
                                                           [{file,
                                                             "/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_install_deps.erl"},
                                                            {line,295}]}]
===> Failed to fetch and copy dep: {elixir,httpoison,"0.9.0"}
@benoitc benoitc added the bug label Aug 14, 2016
@benoitc benoitc added this to the 0.1.0 milestone Aug 14, 2016
@benoitc
Copy link
Member Author

benoitc commented Aug 14, 2016

reading the code here:

https://github.com/barrel-db/rebar3_elixir/blob/master/src/rebar3_elixir_util.erl#L5-L18

It seems you're trying to get the configuration by rereading rebar.config. Why don't you use the rebar api to read the configuration?

also we should have a default configuration if possible. You can look at the elixir path from the env. This snippet allows you to get the path of the elixir or mix binaries. From there you should be able to retrieve the path.

@benoitc benoitc changed the title bug testing a simple example bug testing a simple example: discover elixir if possible Aug 14, 2016
@sivsushruth
Copy link
Contributor

@benoitc Auto discovery enabled with fallback to elixir_opts, view 9051bbc#diff-bdb0c478c1116e1795bc2871d77b6df6R30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants