rebar generate failure

Tim Watson watson.timothy at
Tue Jul 19 20:44:47 EDT 2011

> Here's some background:
> My app uses exmpp as a dependency. I have it installed globally in /usr/local/lib/erlang/lib/exmpp-0.9.7-02-g7305cb8/
> I have updated both <myapp>.app.src and reltool.config appropriately. When I attempt to do a rebar generate, i get
> init terminating in do_boot (Release <myapp> uses non existing application exmpp)
> Looks like this is reltool_server failing to start properly.
> I also think it's worth mentioning that exmpp starts fine when launched from a regular erlang console with application:start(exmpp).
> Any suggestions?

A couple of noteworthy things, which might help. First of all, I
strongly suspect that it is indeed reltool that is failing, and I
would guess it is because you've installed into a directory named
"exmpp-0.9.7-02-g7305cb8". Reltool, IIRC expects an application
directory to be either <appname> or <appname>-<version>, where version
consists of dots and digits. I may be wrong, but it looks to me like
reltool doesn't understand <appname>-<version>-<gobbledegook> where
'gobbledegook' is presumably derived from scm tag or commit info.

Try sym-linking to the install directory using a proper
<appname>-<version> pair and see if it works.

> Mihai
> PS: is anybody aware of a rebar-ified version of exmpp that can be used as a local dependency? The official exmpp project is autotools based, unfortunately.

No, but you can install autotools/make based deps using rebar:

%% rebar.config
{post_hooks, [
    {'get-deps', "cd deps/exmpp && autoconf -vif"}

{pre_hooks, [
    {compile, "cd deps/exmpp && ./configure --prefix=`pwd` && make install"}

That config is probably borked, but you get the general idea.

Another thing you might like to try is not installing 3rd party
libraries into the OTP lib_dir, but instead put them somewhere general
(like in /opt/lib/erlang or whatever) and put that directory into your
ERL_LIBS environment variable. There is a patch in the pipeline (not
yet accepted mind you) so can then put {deps_dir, ["/opt/lib/erlang"]}
in your global config (which using rebar from HEAD lives in
$HOME/.rebar/config) and have all rebar driven projects install into
the same deps_dir - if you want to that is.

Hope that helps.

More information about the rebar mailing list