Hi to all,
I have a strange behaviour when I compile some erlang library with mix. I’m working with riak_core. If I create an empty project with this dependency using rebar3 everything works fine but If I try to creating the same empty project in elixir I receive a strange error:
==> basho_poolboy (compile)
==> riak_core (compile)
Dependency not available: poolboy-0.8.1-p3 ({pkg,basho_poolboy})
ERROR: compile failed while processing /home/gpad/workspace/riak/riak_core_bug/deps/riak_core: rebar_abort
** (Mix) Could not compile dependency :riak_core, "/home/gpad/.mix/rebar compile skip_deps=true deps_dir="/home/gpad/workspace/riak/riak_core_bug/_build/dev/lib"" command failed. You can recompile this dependency with "mix deps.compile riak_core", update it with "mix deps.update riak_core" or clean it with "mix deps.clean riak_core"
I add to mix.exs this dependencies:
defp deps do
[
{:poolboy, "~> 0.8.1-p3", hex: :basho_poolboy},
{:riak_core, "~> 2.2", hex: :riak_core_ng}
]
end
and receive this error:
Unchecked dependencies for environment dev:
* basho_poolboy (Hex package)
could not find an app file at _build/dev/lib/basho_poolboy/ebin/basho_poolboy.app. This may happen if the dependency was not yet compiled, or you specified the wrong application name in your deps, or the dependency indeed has no app file (then you can pass app: false as option)
** (Mix) Can't continue due to errors on dependencies
I think that the problem is related in how rebar3 and mix manage the dependencies. Riak_core has this dependencies bashoo_poolboy, that is a fork of poolboy.
When I get the dependencies with rebar3 I have _build/default/lib/basho_poolboy/ebin/poolboy.app
this with inside:
{application,poolboy,
[{description,"A hunky Erlang worker pool factory"},
{vsn,"0.8.1-p3"},
{pkg_name,"basho_poolboy"},
{applications,[kernel,stdlib]},
{registered,[poolboy]},
{maintainers,["basho","Heinz N. Gies"]},
{licenses,["Apache"]},
{links,[{"Github","https://github.com/basho/riak_sysmon"}]},
{modules,[poolboy,poolboy_sup,poolboy_worker]}]}.
but in mix I have two folders, deps/poolboy/
and deps/basho_poolboy/
and the two app files are:
cat _build/dev/lib/poolboy/ebin/poolboy.app
{application,poolboy,
[{description,"A hunky Erlang worker pool factory"},
{vsn,"0.8.1-p3"},
{pkg_name,"basho_poolboy"},
{applications,[kernel,stdlib]},
{registered,[poolboy]},
{maintainers,["basho","Heinz N. Gies"]},
{licenses,["Apache"]},
{links,[{"Github","https://github.com/basho/riak_sysmon"}]},
{modules,[poolboy,poolboy_sup,poolboy_worker]}]}.
and
cat _build/dev/lib/basho_poolboy/ebin/poolboy.app
{application,poolboy,
[{description,"A hunky Erlang worker pool factory"},
{vsn,"0.8.1-p3"},
{pkg_name,"basho_poolboy"},
{applications,[kernel,stdlib]},
{registered,[poolboy]},
{maintainers,["basho","Heinz N. Gies"]},
{licenses,["Apache"]},
{links,[{"Github","https://github.com/basho/riak_sysmon"}]},
{modules,[poolboy,poolboy_sup,poolboy_worker]}]}.
What do you think?