barrel-db / rebar3_elixir_compile

Elixir rebar3 compiler plugin
Other
90 stars 29 forks source link

Doesn't fetch dependencies recursively? #16

Closed drozzy closed 7 years ago

drozzy commented 7 years ago

Trying to depend on extreme lib with this plugin, it seems like it's not fetching any of the dependencies. Is this expected behaviour?

E.g. I have to put all of them into my rebar3 config:

 {idna, {elixir, "idna", "4.0"}},
  {hackney, {elixir, "hackney", "1.6"}},  
  {httpoison, {elixir, "httpoison", "0.10.0"}},
  {gpb, {elixir, "gpb", "3.24"}},
  {exprotobuf, {elixir, "exprotobuf", "1.2.1"}}

(not working yet - but I will keep debugging)

drozzy commented 7 years ago

This is even stranger, now I'm getting an error like this:

 DEBUG=1 ./rebar3 shell
===> sh info:
        cwd: "/projects/myapp"
        cmd: elixir -e 'IO.puts :code.lib_dir(:elixir)'

===>    opts: []

===> Port Cmd: elixir -e 'IO.puts :code.lib_dir(:elixir)'
Port Opts: [exit_status,{line,16384},use_stdio,stderr_to_stdout,hide,eof]

===> Expanded command sequence to be run: [{default,app_discovery},
                                                  {default,install_deps},
                                                  {default,lock},
                                                  {default,compile},
                                                  {default,shell}]
===> Evaluating config script "/projects/myapp/_build/default/lib/gproc/rebar.config.script"
===> Not adding provider default medoc from module medoc because it already exists from module medoc
===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user
===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut
===> Not adding provider hex config from module rebar3_hex_config because it already exists from module rebar3_hex_config
===> Not adding provider hex key from module rebar3_hex_key because it already exists from module rebar3_hex_key
===> Not adding provider hex info from module rebar3_hex_info because it already exists from module rebar3_hex_info
===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner
===> Not adding provider hex docs from module rebar3_hex_docs because it already exists from module rebar3_hex_docs
===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search
===> Not adding provider hex publish from module rebar3_hex_pkg because it already exists from module rebar3_hex_pkg
===> Not adding provider ex compile from module rebar3_elixir_compile_prv_ex_compiler because it already exists from module rebar3_elixir_compile_prv_ex_compiler
===> sh info:
        cwd: "/projects/myapp"
        cmd: elixir -e 'IO.puts :code.lib_dir(:elixir)'

===>    opts: []

===> Port Cmd: elixir -e 'IO.puts :code.lib_dir(:elixir)'
Port Opts: [exit_status,{line,16384},use_stdio,stderr_to_stdout,hide,eof]

===> Verifying dependencies...
===> Evaluating config script "/projects/myapp/_build/default/lib/gproc/rebar.config.script"
===> 19.0 satisfies the requirement for minimum OTP version 18.0
===> Evaluating config script "/projects/myapp/_build/default/lib/stringprep/rebar.config.script"
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,
                             {error,
                              {107,file,
                               {error,
                                {badmatch,
                                 ["3","2","0+build","3531","ref2c78cfd"]},
                                [{erl_eval,expr,3,[]}]}}}}
===> Stack trace to the error location: [{io_lib_pretty,
                                                 cind_tag_tuple,7,
                                                 [{file,"io_lib_pretty.erl"},
                                                  {line,637}]},
                                                {io_lib_pretty,cind_element,
                                                 7,
                                                 [{file,"io_lib_pretty.erl"},
                                                  {line,726}]},
                                                {io_lib_pretty,cind_list,7,
                                                 [{file,"io_lib_pretty.erl"},
                                                  {line,696}]},
                                                {io_lib_pretty,cind_element,
                                                 7,
                                                 [{file,"io_lib_pretty.erl"},
                                                  {line,726}]},
                                                {io_lib_pretty,cind_tail,8,
                                                 [{file,"io_lib_pretty.erl"},
                                                  {line,709}]},
                                                {io_lib_pretty,cind_element,
                                                 7,
                                                 [{file,"io_lib_pretty.erl"},
                                                  {line,726}]},
                                                {io_lib_pretty,cind_list,7,
                                                 [{file,"io_lib_pretty.erl"},
                                                  {line,696}]},
                                                {io_lib_pretty,cind_element,
                                                 7,
                                                 [{file,"io_lib_pretty.erl"},
                                                  {line,726}]}]

Here is my rebar.config:

{erl_opts, [debug_info]}.

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

{deps, [
  {gproc, "0.5.0"},
  % {uuid, "1.5.2-rc1", {pkg, uuid_erl}},
  {erlbus, {git, "https://github.com/cabol/erlbus.git", {tag, "0.2.0"}}},
  %% Extreme deps       %%%
  {mimerl, "1.1.0"},
  {gpb, "3.26.5"},
  {metrics, "2.2.0"},
  {idna, "3.0.0"},
  {hackney, "1.6.3"},
  {extreme, {elixir, "extreme", "0.7.1"}}
  % {idna, {elixir, "idna", "4.0"}},
  % {hackney, {elixir, "hackney", "1.6"}},  
  % {httpoison, {elixir, "httpoison", "0.10.0"}},
  % {poison, {elixir, "poison", "3.0.0"}},
  % {exprotobuf, {elixir, "exprotobuf", "1.2.1"}},
  % Indirect dependency - used when genering uuids from extreme
  % {uuid, {elixir, "uuid", "1.1.4"}}
  %% End of extreme deps %%
]}.

% Fix Httpc Profiles working in the rebar3 shell:
% - stop inets from automatically starting in the shell
% - inets is started by relx
% - this does not affect release, only rebar3 shell
{shell, [{script_file, "stopinets.escript"}]}.

{relx, [{release, { myapp, "7.1.0" },
         [ebus,  % Start ebus first
          myapp,
          bee_www,
          bee_twitter_stream,
          inets,
          ssl,
          sasl]},

        {sys_config, "./config/sys.config"},
        {vm_args, "./config/vm.args"},

        {dev_mode, true},
        {include_erts, false},

        {extended_start_script, true}]
}.

{profiles, [{prod, [{relx, [{dev_mode, false},
                            {include_erts, true}]}]
            }]
}.

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

{elixir_opts, 
  [
    {env, dev}
  ]
}.
drozzy commented 7 years ago

Nevermind. Starting with a new project from scratch seems to work. This was something unrelated probably.