[erlang-questions] Reltool error: "Module potentially included by two different applications"

Siri Hansen <>
Tue Jul 3 15:25:26 CEST 2012


Hi Eduard - sorry for the long delay! Here are some thoughts about this
issue.

The principle here is that reltool shall never guess. I.e. as long as it
can not be 100% sure which of the two modules to use, then it will not
choose but expects you to explicitely make the decision.

Since you haven't included your reltool config file, I'm just guessing that
it looks (maybe simplified) something like this:

{sys,[{lib_dirs,["<my_lib_dir>"]},
      {incl_cond,derived},
      {app,<my_app>,[{incl_cond,include}]}
     ]}.

and that <system_app> exists in <my_lib_dir>.

If this is close to correct, then what you ask reltool to do is

"Take my erlang installation and also look in <my_lib_dir> and figure out
which applications and modules I need to include in my release so that all
dependencies of <my_app> are taken care of."

And to be very strict - it could(!!) be that you want <my_app> to use the
<some_module> from <system_app> and not from <my_app> itself... but I
realize that it is not very likely. At least not if <some_module> is the
only relation between <my_app> and <system_app>... So the question is if
this is ALWAYS the case??

A simple workaround for the above config file would be to skip the system
level lib_dirs parameter, and specify directory per application instead:

{sys,[{incl_cond,derived},
      {app,<my_app>,[{incl_cond,include},{lib_dir,"<my_lib_dir>/<my_app>"]}
     ]}.

This will of course only work as long as there are no other dependecies
from <my_app> towards other applications in <my_lib_dir>...

Regards
/siri



2012/6/15 Eduard Sergeev <>

> Hi,
>
> I was wondering what was the reason behind the following behaviour of
> reltool:
>
> If my reltool.config uses default 'mod_cond' and 'incl_cond' options
> and if one of my included applications has a module which also happens
> to be a part of some application installed on my machine but NOT
> included in my release `relltool:get_target_spec/1` returns:
>
> {error, "Module <some_module> potentially included by two different
> applications: <system_app> and <my_app>."}
>
> Which is annoying since <system_app> is NOT a part of my release
> (neither directly nor indirectly). Can't reltool actually figure out
> that <system_app> will not be included in my release? Id that why it
> is "potentially included"?
>
> Anyway, in order to generate my release I have to either explicitly
> exclude <system_app> via `{app, <system_app> [{incl_cond, exclude}]}`
> which is ugly since this <system_app> is just happens to be installed
> in 'lib' directory of the machine where I do the build (it may not be
> installed on other build machines) and has nothing to do with my
> release. The actual example: 'tsung-1.4.3' includes 'mochijson2'
> module so I have a problem building my release which should include
> 'mochiweb' app on the machine that has 'tsung' installed (but not on
> other machines).
> Another option would be to change top-level 'incl_cond' from
> {incl_cond, derived} to {incl_cond, exclude} and then manually include
> all the application which I want to be a part my release which is
> better (will work on any build machine) but still not great since it
> has to be done manually (I want to rely on relltool to figure out the
> dependencies).
>
> So the question is why do we have such a situation? Why just a mere
> presence of some application on the build machine lead to the above
> reltool error?
>
> Regards,
> Eduard
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120703/7a678454/attachment.html>


More information about the erlang-questions mailing list