Tags
Today I was exposed to an erlang package management tool called agner. It wasn’t something I was expecting to appear, but appear it did as a dependency to a dependency. While the docs say that it is rebar compatible, including a plugin for rebar, there is a slight gotcha in release management if you are caught unaware. Basically, the dependencies pulled in via agner do not appear in the top-level deps as other rebar dependencies do. This causes problems in building the release since reltool can’t locate all of the deps.
{badmatch,false},[{reltool_target,init_rel_app,2}
Thankfully, the solution is rather straight-forward: add the dependency’s deps directory to the lib_dirs property.
While a general package management tool is useful (especially if it could make rebar and faxien play nicely together), it looks as though the integration could use some improvement.
This seems to be the only answer to this problem on Internet. So I’ll give here more info on the subject.
While building a project with rebar, anger, or any other tool that uses reltool under the hood and you get:
{“init terminating in do_boot”,{{badmatch,false},[{reltool_target,init_rel_app,2},{reltool_target,do_merge_apps,5},{reltool_target,merge_apps,2},{reltool_target,do_spec_rel_files,2},{reltool_target,’-spec_rel_files/1-lc$^0/1-0-‘,2},{reltool_target,spec_rel_files,1},{reltool_target,do_gen_spec,1},{reltool_target,gen_spec,1}]}}
This might also mean that one of your dependencies is spelled wrong. For example `epgsql_pooler’ instead of `epgsql_pool’. The above error doesn’t tell you what is wrong exactly. So you should patch reltool_target.erl to get more meaningfull error message like:
ERROR: Unable to generate spec: Application epgsql_pooler is used, but not included
init_rel_app(Name, Apps) ->
case lists:keysearch(Name, #app.name, Apps) of
false ->
reltool_utils:throw_error(
“Application ~p is used, but not included”,
[Name]);
{value, App} ->
Info = App#app.info,
#rel_app{name = Name,
app_type = undefined,
incl_apps = Info#app_info.incl_apps}
end.
This error is applied to …, R14B04, R15B.
LikeLike