[erlang-questions] Ability to add app directories explicitly for reltool

Dmitry Demeshchuk <>
Tue Dec 20 20:12:37 CET 2011

Hello, Siri and everyone.

Recently I've been trying to start using OTP releases in our projects
with help of rebar. However, I faced the following problem.

Rebar expects that *all* Erlang code resides in some directory
(generally, "deps" folder) or several directories. This is a reltool
strict requirement, as far as I understand. Unlike, Riak, all our
applications have the following directory structure:


So, we pull some libraries (and sometimes smaller applications) as
deps, but the main application's code resides in the root application
folder. And there's no way to make reltool include this code into the
generated release, or at least I don't see it.

For now, there are 2 ways for me to solve this without affecting reltool itself:

1. For all apps, make another repository that just pulls our
application and all its deps, so the actual application code resides
in the deps/ dir as well, and generate the release package from it.
However, this seems like an overhead to me. Moreover, this isn't
convenient for development.

2. I made a hack that creates symlinks in the deps/ dir, so that it
seems to reltool that the core application actually resides in the
deps/ folder, so it's included into the release. Obviously, this is
kinda ugly and potentially buggy, forget total Windows
incompatibility. Initially, this was a pull request to rebar but after
some thinking me and one of rebar's maintainers agreed that it's
better to make this code a rebar plugin.

So, as you can see, both of the solutions aren't perfect. The ideal
way I can see is an ability to set explicit app directories in
reltool.config, like:

{explicit_app_dirs, ["/apps/myapp1"]}.

Probably, it won't make any other use besides the problem I'm
describing here, but at least it's quite general and doesn't seem like
a hack. Maybe there's a better way that I didn't come up with. Or
maybe reltool can do what I want, and I just don't know about such an

This seems like a very useful feature. I know that many people use
just the same directory structure in their projects. Also, rebar
maintainers already gave me their +1 to this. I'll be glad to work on
the patch if we come up with a good solution.

Thank you.

Best regards,
Dmitry Demeshchuk

More information about the erlang-questions mailing list