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

All dependencies have to be explicitly stated #30

Open
CrowdHailer opened this issue May 20, 2018 · 3 comments
Open

All dependencies have to be explicitly stated #30

CrowdHailer opened this issue May 20, 2018 · 3 comments

Comments

@CrowdHailer
Copy link

This plug in appears to pull all the dependencies of a hex project. however unless the are all added to the list of deps then they are not compiled/included.

I have a small rebar3 project using Ace, an elixir dependency which has further dependencies.
This is the section of my rebar.config file which should only need to have ace declared https://github.com/CrowdHailer/greetings-ace-raxx-erlang-example/blob/master/rebar.config#L3-L6

@benoitc
Copy link
Member

benoitc commented May 20, 2018

This plug in appears to pull all the dependencies of a hex project. however unless the are all added to the list of deps then they are not compiled/included.

what do you mean exactly? That it doesn't take the deps from your mix file or smth else?

@CrowdHailer
Copy link
Author

Yes the deps of an included project are not pulled from the projects mix.exs when using rebar3 eunit or rebar shell

For example if I update my rebar.config to the following.

{erl_opts, [debug_info]}.
{deps, [
  {ace, {elixir, "ace", "0.16.4"}}
  % {raxx, {elixir, "raxx", "0.15.4"}},
  % {hpack, "0.2.3", {pkg, hpack_erl}},
  % {cookie, {elixir, "cookie", "0.1.0"}}
]}.

{plugins, [
    { rebar3_elixir_compile, ".*", {git, "https://github.com/barrel-db/rebar3_elixir_compile.git", {branch, "master"}}}
]}.

{provider_hooks, [
  {pre, [{compile, {ex, compile}}]}
]}.

{elixir_opts,
  [
    {env, dev}
  ]
}.

{shell, [{apps, [greetings]}]}.

When I run rebar3 shell I see:

==> raxx
Compiling 13 files (.ex)
Generated raxx app
==> ace
Compiling 27 files (.ex)
Generated ace app
===> Compiling ace
===> Compiling greetings
===> Adding Elixir Libs
src/greetings_www.erl:3: Warning: behaviour 'Elixir.Raxx.Server' undefined

There is that line that says the dependencies of my dependency where compile. But only the explicitly declared dependency is available in the shell.
concretely my project depends on ace, and ace depends on raxx.

2> 'Elixir.Ace.HTTP.Service':module_info(). 
[{module,'Elixir.Ace.HTTP.Service'}, ...
3> 'Elixir.Raxx':module_info().
** exception error: undefined function 'Elixir.Raxx':module_info/0

@aherranz
Copy link

aherranz commented Sep 6, 2018

I think I am suffering the same problem.

  • I have an Erlang app.
  • I have an elixir app in elixir_libs/pet_repo.
  • pet_repo depends on ecto and postgresx with proper configuration.
  • The plugin compiles and puts all elixir dependencies (ecto and postgrex among them) in _build.
  • I add pet_repo to the applications of my erlang app.src file

At least with rebar shell, I cannot start my erlang app because dependency app files cannot be found:

1> application:ensure_all_started(pet).

=INFO REPORT==== 6-Sep-2018::08:42:58 ===
    application: logger
    exited: stopped
    type: temporary

=INFO REPORT==== 6-Sep-2018::08:42:58 ===
    application: elixir
    exited: stopped
    type: temporary

{error,{postgrex,{"no such file or directory",
                  "postgrex.app"}}}
2> 

I can try to build a PR the reproduce the problem in the plugin repo (demo).

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

3 participants