Mix deps mismatch ?

89 views
Skip to first unread message

Josef Vanek

unread,
Jun 7, 2016, 9:22:57 AM6/7/16
to elixir-lang-talk
Hi everyone,

We are working actually on an Elixir project which involves several subprojects.
I'd rather prefer to think about like several frameworks and one application which
uses modules from those frameworks, and so has compile dependencies on them.

So let's say we have Model and Core frameworks and then Presentation application.

Now the strange think happens from time to time (not always, this is a problem) when
suddenly when we launch mix deps.get we get following message:

Dependencies have diverged:
* model (git@bitbucket.org:playrz/model.git) the dependency model in mix.exs is overriding a child dependency:
 
> In mix.exs: {:model, nil, [git: "g...@bitbucket.org:playrz/model.git", tag: "builds/57", manager: :mix]}
 
> In deps/core/mix.exs: {:model, nil, [git: "g...@bitbucket.org:playrz/model.git", tag: "builds/42"]}


However in bitbucket those projects are all correctly tagged, with:

Core is tagged builds/40 in bitbucket,
Core's mix.exs deps:

@common_deps [
   
{:model, git: "g...@bitbucket.org:playrz/model.git", tag: "builds/57"},
   
{:exlager, github: "intellicore/exlager", tag: "r1.2"},
   
{:logger_lager_backend, "~> 0.0"},
   
{:tzdata, "~> 0.5"},
   
{:unit_fun, "~> 0.5"},
   
{:amnesia, "~> 0.2"},
   
{:poison, "~> 2.1", override: :true},  # dep overriden from ecto, where it is declared as optional
   
{:gproc, "~> 0.5"},
   
{:exprof, "~> 0.2"},
   
{:eflame, ~r/.*/, git: "https://github.com/proger/eflame.git", compile: "rebar compile"},
   
{:meck, github: "eproxus/meck", tag: "0.8.2", override: true},
   
{:edown, github: "uwiger/edown", tag: "0.7", override: true},
   
{:lager, github: "basho/lager", tag: "2.1.0", override: true},
   
{:elixometer, github: "intellicore/elixometer"},
   
{:ex_machina, "~> 0.6"},
   
{:faker, "~> 0.6"}
 
]

  defp deps
(:test) do
   
[
     
{:cobertura_cover, "~> 0.9"}
   
] ++ @common_deps
 
end

  defp deps
(:docs) do
   
[
     
{:ex_doc, "~> 0.11", only: :docs},
     
{:earmark, "~> 0.2", only: :docs}
   
] ++ @common_deps
 
end

  defp deps
(_) do
   
@common_deps
 
end


And mix.exs from Presentation (top-level) app:

  @common_deps [
   
{:model, git: "g...@bitbucket.org:playrz/model.git", tag: "builds/57"},
   
{:core, git: "g...@bitbucket.org:playrz/core.git", tag: "builds/40"},
   
{:ex_machina, "~> 0.6"},
   
{:faker, "~> 0.6"},
   
{:logger_lager_backend, "~> 0.0"},
   
{:poison, "~> 2.1", override: true},
   
{:gproc, "~> 0.5"},
   
{:timex, "~> 1.0"},
   
{:erlcloud, "~> 0.13", manager: :rebar3},
   
{:meck, github: "eproxus/meck", tag: "0.8.2", override: true},
   
{:edown, github: "uwiger/edown", tag: "0.7", override: true},
   
{:lager, github: "basho/lager", tag: "2.1.0", override: true}
 
]

  defp deps
(:test) do
   
[
     
{:cobertura_cover, "~> 0.9"},
     
{:temp, "~> 0.4"},
     
{:exprof, "~> 0.2"},
     
{:ex_machina, "~> 0.6"},
     
{:faker, "~> 0.6"}
   
] ++ @common_deps
 
end

  defp deps
(:docs) do
   
[
     
{:ex_doc, "~> 0.11", only: :docs},
     
{:earmark, "~> 0.2", only: :docs}
   
] ++ @common_deps
 
end

  defp deps
(_) do
   
@common_deps
 
end




Could someone explain to me how mix deps.get can get msimatched on the tag of the model dependency ?
And more importnatly only from time to time....

We'd like to use Jenkins automated builds but we have issues finding a correct way of handling dependencies.

We've already tried to do mix deps.clean --all, or to completely remove the deps and _build directories.

Any clues ?

Thx

José Valim

unread,
Jun 7, 2016, 9:51:27 AM6/7/16
to elixir-l...@googlegroups.com
Can you please try Elixir v1.3.0-rc.0? We had one or two bugs in this area that we have fixed for the v1.3 release.



José Valim
Skype: jv.ptec
Founder and Director of R&D

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/7f150965-2465-4ce0-a9f6-67cd09c7fcf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

José Valim

unread,
Jun 7, 2016, 9:53:06 AM6/7/16
to elixir-l...@googlegroups.com
It is also worth pointing out that Mix prefers this style:

def deps do
  [{:foo, "0.1"},
   {:bar, "0.2", only: :test},
   {:baz, "0.3", only: :dev}]
end

Instead of multiple deps clauses.





José Valim
Skype: jv.ptec
Founder and Director of R&D

Josef Vanek

unread,
Jun 7, 2016, 9:56:13 AM6/7/16
to elixir-l...@googlegroups.com
Ok, thanks José, we'll try changing the deps syntax and eventually compiling elixir 1.3.0

Josef
Reply all
Reply to author
Forward
0 new messages