[erlang-questions] Re: [erlang-questions 71] Erlang release generation

Per Melin <>
Mon Mar 28 22:31:34 CEST 2011


On Mon, Mar 28, 2011 at 8:07 AM, Sam Bobroff <> wrote:
> I've been trying to work out how to "properly" build Erlang releases (on
> a Linux system, to be deployed on another Linux system), and I'm getting
> nowhere fast so I'm hoping someone here will have some useful pointers
> or hints to help me out.

I spent many, many hours in utter frustration before I got this
working for the first time. I now use a ~400 line escript that I wrote
that glues together reltool, systools and release_handler.

What follows should be the minimal release possible with a custom boot
file. I create a dummy app called foo that doesn't have any modules,
only a foo.app.

fanboy:~$ mkdir -p /tmp/minirel
fanboy:~$ cd /tmp/minirel
fanboy:minirel$ mkdir -p lib/foo/ebin
fanboy:minirel$ cat > lib/foo/ebin/foo.app
{application, foo,
 [{description, ""},
  {vsn, "1.0.0"},
  {modules, []},
  {registered, []},
  {included_applications, []},
  {applications, [kernel,stdlib]},
  {env, []}]}.

fanboy:minirel$ mkdir rel
fanboy:minirel$ erl
Erlang R14B02 (erts-5.8.3) [source] [smp:2:2] [rq:2] [async-threads:0]
[hipe] [kernel-poll:false]

Eshell V5.8.3  (abort with ^G)
1> reltool:create_target([{sys, [{lib_dirs, ["lib"]}, {app, foo,
[{incl_cond, include}]}, {incl_archive_filters, []},  {rel, "foo",
"001", [foo, kernel, stdlib, sasl]}, {boot_rel, "foo"}]}], "rel").
ok
2>
User switch command
 --> q
fanboy:minirel$ ls -1F rel/
Install*
bin/
erts-5.8.3/
lib/
misc/
releases/
usr/
fanboy:minirel$ ls rel/lib/foo-1.0.0/
ebin
fanboy:minirel$ ls rel/releases/001/
foo.boot	foo.rel		foo.script

---

And even when you get this far, it is just the first step on a painful
journey. But once you get it working all the way it's a beautiful
thing.

(Since R14 I don't think you need the {app, foo, [{incl_cond,
include}]} anymore if you list your app in the rel-tuple.)



More information about the erlang-questions mailing list