barrel-db / rebar3_elixir_compile

Elixir rebar3 compiler plugin
Other
90 stars 29 forks source link

elixir deps are not added to the lock file #8

Closed benoitc closed 8 years ago

benoitc commented 8 years ago

I was trying a modified version of the demo:

diff --git a/examples/demo/rebar.config b/examples/demo/rebar.config
index 7be3b6b..157f6f3 100644
--- a/examples/demo/rebar.config
+++ b/examples/demo/rebar.config
@@ -5,12 +5,13 @@
 ]}.

 {deps, [
- {decimal, {elixir, "decimal" ,"1.1.0"}}
+ {decimal, {elixir, "decimal" ,"1.1.0"}},
+ {httpoison, {elixir, "httpoison", "0.9.0"}}
 ]}.

 {provider_hooks, [{post, [{compile, {ex, compile}}]}]}.
-{elixir_opts,
+{elixir_opts,
   [
     {env, dev}
   ]
-}.
\ No newline at end of file
+}.
diff --git a/examples/demo/rebar.lock b/examples/demo/rebar.lock
index c6f33b5..5f31bfb 100644
--- a/examples/demo/rebar.lock
+++ b/examples/demo/rebar.lock
@@ -1 +1,2 @@
-[{<<"decimal">>,{elixir,"decimal","1.1.0"},0}].
+[{<<"decimal">>,{elixir,"decimal","1.1.0"},0},
+ {<<"httpoison">>,{elixir,"httpoison","0.9.0"},0}].
diff --git a/examples/demo/src/demo.app.src b/examples/demo/src/demo.app.src
index 83d4eb4..c024c4e 100644
--- a/examples/demo/src/demo.app.src
+++ b/examples/demo/src/demo.app.src
@@ -7,7 +7,9 @@
    [kernel,
     stdlib,
     crypto,
-    elixir
+    elixir,
+    decimal,
+    httpoison
    ]},
   {env,[]},

but the lock file is not updated when doing rebar3 compile, only httpoison is added to it but none of the deps are fetched via mix. More over running the application return the following:

[demo] rebar3 shell                                               20:58:43  ☁  master ☂ ⚡
===> Compiling rebar3_elixir
===> Verifying dependencies...
===> Upgrading decimal ({elixir,"decimal","1.1.0"})
Dependency decimal already exists

A new Hex version is available (0.13.0), please update with `mix local.hex`
ex_doc is missing its version requirement, use ">= 0.0.0" if it should match any version
earmark is missing its version requirement, use ">= 0.0.0" if it should match any version
Running dependency resolution
All dependencies up to date
A new Hex version is available (0.13.0), please update with `mix local.hex`
Running dependency resolution
All dependencies up to date
===> Upgrading httpoison ({elixir,"httpoison","0.9.0"})
Dependency httpoison already exists

A new Hex version is available (0.13.0), please update with `mix local.hex`
ex_doc is missing its version requirement, use ">= 0.0.0" if it should match any version
earmark is missing its version requirement, use ">= 0.0.0" if it should match any version
Running dependency resolution
All dependencies up to date
A new Hex version is available (0.13.0), please update with `mix local.hex`
Running dependency resolution
All dependencies up to date
===> Compiling demo
===> Adding Elixir Libs
Erlang/OTP 18 [erts-7.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:0] [kernel-poll:false]

Eshell V7.2.1  (abort with ^G)
1>  demo_app:decimal_demo_run().
Result is : #{'__struct__' => 'Elixir.Decimal',coef => 11,exp => 0,sign => 1}ok
2> 'Elixir.String':downcase(<<"TEST">>).
<<"test">>
3> application:ensure_all_started(httpoison).
{error,{hackney,{"no such file or directory",
                 "hackney.app"}}}
4>
=INFO REPORT==== 14-Aug-2016::21:01:13 ===
    application: elixir
    exited: stopped
    type: temporary

=INFO REPORT==== 14-Aug-2016::21:01:13 ===
    application: compiler
    exited: stopped
    type: temporary

4>

So it seems that it doesn't find hackney.

sivsushruth commented 8 years ago

So @benoitc run rebar3 compile and then rebar3 shell, lock gets updated Let me know

benoitc commented 8 years ago

fixed in latest master.