barrel-db / rebar3_elixir_compile

Elixir rebar3 compiler plugin
Other
90 stars 29 forks source link

`rebar3 ct` doesn't work #19

Closed ferigis closed 7 years ago

ferigis commented 7 years ago

Hi, We have problems trying to run rebar3 ct in our project after using your plugin. I have been testing with the demo and I could reproduce the error there. This is the error I get if I run rebar3 ct in the demo's folder (from rebar3.crashdump):

Error: function_clause
[{filename,do_flatten,[47,[]],[{file,"filename.erl"},{line,974}]},
 {filename,basename,2,[{file,"filename.erl"},{line,234}]},
 {rebar_utils,'-update_code/2-fun-0-',2,
              [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_utils.erl"},
               {line,724}]},
 {lists,foreach,2,[{file,"lists.erl"},{line,1338}]},
 {rebar_prv_common_test,do,2,
                        [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_common_test.erl"},
                         {line,51}]},
 {rebar_core,do,2,
             [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_core.erl"},
              {line,153}]},
 {rebar3,main,1,
         [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar3.erl"},
          {line,66}]},
 {escript,run,2,[{file,"escript.erl"},{line,760}]}]

Digging deeper in our project I saw the problem is with the all_deps property in the rebar3 state, this is how it looks:

[all_deps,47,85,115,101,114,115,47,102,101,114,105,103,105,115,47,119,
      111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,105,110,97,
      107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,100,47,100,
      101,102,97,117,108,116,47,112,108,117,103,105,110,115,47,46,46,47,108,
      105,98,47,98,117,110,116,47,101,98,105,110,47,85,115,101,114,115,47,102,
      101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,47,101,114,
      108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,111,110,47,
      95,98,117,105,108,100,47,100,101,102,97,117,108,116,47,112,108,117,103,
      105,110,115,47,46,46,47,108,105,98,47,99,114,101,100,111,47,101,98,105,
      110,47,85,115,101,114,115,47,102,101,114,105,103,105,115,47,119,111,114,
      107,115,112,97,99,101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,
      115,104,101,108,100,111,110,47,95,98,117,105,108,100,47,100,101,102,97,
      117,108,116,47,112,108,117,103,105,110,115,47,46,46,47,108,105,98,47,
      100,105,97,108,121,120,105,114,47,101,98,105,110,47,85,115,101,114,115,
      47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,47,
      101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,111,
      110,47,95,98,117,105,108,100,47,100,101,102,97,117,108,116,47,112,108,
      117,103,105,110,115,47,46,46,47,108,105,98,47,101,97,114,109,97,114,107,
      47,101,98,105,110,47,85,115,101,114,115,47,102,101,114,105,103,105,115,
      47,119,111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,105,
      110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,100,
      47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,46,47,108,105,
      98,47,98,117,110,116,47,101,98,105,110,47,85,115,101,114,115,47,102,101,
      114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,47,101,114,108,
      97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,
      117,105,108,100,47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,
      46,47,108,105,98,47,99,114,101,100,111,47,101,98,105,110,47,85,115,101,
      114,115,47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,
      101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,
      100,111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,112,108,117,
      103,105,110,115,47,46,46,47,108,105,98,47,100,105,97,108,121,120,105,
      114,47,101,98,105,110,47,85,115,101,114,115,47,102,101,114,105,103,105,
      115,47,119,111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,
      105,110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,
      100,47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,46,47,108,
      105,98,47,101,97,114,109,97,114,107,47,101,98,105,110,47,85,115,101,114,
      115,47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,
      47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,
      111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,112,108,117,103,
      105,110,115,47,46,46,47,108,105,98,47,98,117,110,116,47,101,98,105,110,
      47,85,115,101,114,115,47,102,101,114,105,103,105,115,47,119,111,114,107,
      115,112,97,99,101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,
      104,101,108,100,111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,
      112,108,117,103,105,110,115,47,46,46,47,108,105,98,47,99,114,101,100,
      111,47,101,98,105,110,47,85,115,101,114,115,47,102,101,114,105,103,105,
      115,47,119,111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,
      105,110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,
      100,47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,46,47,108,
      105,98,47,100,105,97,108,121,120,105,114,47,101,98,105,110,47,85,115,
      101,114,115,47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,
      97,99,101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,
      108,100,111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,112,108,
      117,103,105,110,115,47,46,46,47,108,105,98,47,101,97,114,109,97,114,107,
      47,101,98,105,110,
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/goldrush/ebin",
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/aleppo/ebin",
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/zipper/ebin",
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/lager/ebin",
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/katana_code/ebin",
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/getopt/ebin",
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/xref_runner/ebin",
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/elvis/ebin",
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/default/lib/earmark/ebin",
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/mixer/ebin",
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/katana_test/ebin",
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/sheldon/ebin",
      "/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/sheldon/test"]],

where all those integers would make sense if they were in a list.

1> [47,85,115,101,114,115,47,102,101,114,105,103,105,115,47,119,
1>       111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,105,110,97,
1>       107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,100,47,100,
1>       101,102,97,117,108,116,47,112,108,117,103,105,110,115,47,46,46,47,108,
1>       105,98,47,98,117,110,116,47,101,98,105,110,47,85,115,101,114,115,47,102,
1>       101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,47,101,114,
1>       108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,111,110,47,
1>       95,98,117,105,108,100,47,100,101,102,97,117,108,116,47,112,108,117,103,
1>       105,110,115,47,46,46,47,108,105,98,47,99,114,101,100,111,47,101,98,105,
1>       110,47,85,115,101,114,115,47,102,101,114,105,103,105,115,47,119,111,114,
1>       107,115,112,97,99,101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,
1>       115,104,101,108,100,111,110,47,95,98,117,105,108,100,47,100,101,102,97,
1>       117,108,116,47,112,108,117,103,105,110,115,47,46,46,47,108,105,98,47,
1>       100,105,97,108,121,120,105,114,47,101,98,105,110,47,85,115,101,114,115,
1>       47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,47,
1>       101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,111,
1>       110,47,95,98,117,105,108,100,47,100,101,102,97,117,108,116,47,112,108,
1>       117,103,105,110,115,47,46,46,47,108,105,98,47,101,97,114,109,97,114,107,
1>       47,101,98,105,110,47,85,115,101,114,115,47,102,101,114,105,103,105,115,
1>       47,119,111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,105,
1>       110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,100,
1>       47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,46,47,108,105,
1>       98,47,98,117,110,116,47,101,98,105,110,47,85,115,101,114,115,47,102,101,
1>       114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,47,101,114,108,
1>       97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,
1>       117,105,108,100,47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,
1>       46,47,108,105,98,47,99,114,101,100,111,47,101,98,105,110,47,85,115,101,
1>       114,115,47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,
1>       101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,
1>       100,111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,112,108,117,
1>       103,105,110,115,47,46,46,47,108,105,98,47,100,105,97,108,121,120,105,
1>       114,47,101,98,105,110,47,85,115,101,114,115,47,102,101,114,105,103,105,
1>       115,47,119,111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,
1>       105,110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,
1>       100,47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,46,47,108,
1>       105,98,47,101,97,114,109,97,114,107,47,101,98,105,110,47,85,115,101,114,
1>       115,47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,
1>       47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,
1>       111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,112,108,117,103,
1>       105,110,115,47,46,46,47,108,105,98,47,98,117,110,116,47,101,98,105,110,
1>       47,85,115,101,114,115,47,102,101,114,105,103,105,115,47,119,111,114,107,
1>       115,112,97,99,101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,
1>       104,101,108,100,111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,
1>       112,108,117,103,105,110,115,47,46,46,47,108,105,98,47,99,114,101,100,
1>       111,47,101,98,105,110,47,85,115,101,114,115,47,102,101,114,105,103,105,
1>       115,47,119,111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,
1>       105,110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,
1>       100,47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,46,47,108,
1>       105,98,47,100,105,97,108,121,120,105,114,47,101,98,105,110,47,85,115,
1>       101,114,115,47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,
1>       97,99,101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,
1>       108,100,111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,112,108,
1>       117,103,105,110,115,47,46,46,47,108,105,98,47,101,97,114,109,97,114,107,
1>       47,101,98,105,110].
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/default/plugins/../lib/bunt/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/default/plugins/../lib/credo/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/default/plugins/../lib/dialyxir/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/default/plugins/../lib/earmark/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/bunt/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/credo/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/dialyxir/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/earmark/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/bunt/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/credo/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/dialyxir/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/earmark/ebin"
ferigis commented 7 years ago

probably the PR #18 by @loucash will fix it

loucash commented 7 years ago

@ferigis correct, I had exactly same problem.

benoitc commented 7 years ago

pr is merged. Can you try against latest master and let me know if it fixes your issue? I will test myself later tonight.

ferigis commented 7 years ago

@benoitc I have tested and it seems it is working fine now. Thanks