[erlang-questions] Good practice for binary distributing

Matt Stancliff sysop@REDACTED
Sun May 30 04:57:10 CEST 2010


Hey Max,

On May 29, 2010, at 2:43 AM, Max Lapshin wrote:
> Questions are:
> 1) is it possible to pack whole application into one java-like jar
> file, where all required beams and app file will be?

   Check out "Loading of Code From Archive Files" at
http://www.erlang.org/doc/man/code.html

   Though, everybody should be using rebar to build and
distribute erlang apps: http://hg.basho.com/rebar/src

   Use the rebar control scripts.  Use reltool with the
help of rebar.  Use the rebar/OTP directory layout.  Use
the rebar testing hooks.  Use the rebar management of your
dependencies (no git submodules).

   Rebar, oddly, has no docs though.  Check out some other
projects using it for how to layout your code.  Examples:
http://hg.basho.com/riak/src http://hg.basho.com/innostore/src

   I rebar-ized OMS last month.  Take a look to see how things
were laid out before and after.
   Before (autotools): http://github.com/mattsta/oms-matt/tree/5b50c1
   After (rebar): http://github.com/mattsta/oms-matt/
Same with an erlang redis library:
   Before (Emakefile, Makefile, Rakefile, rebar): http://github.com/mattsta/er/tree/20bcb6
   After (rebar-only): http://github.com/mattsta/er/

> 2) what are practices for compiling modules into such binary
> distribution: remove debug, etc. ?

   Look at http://www.erlang.org/doc/man/beam_lib.html
You can encrypt your debug info so it's still usable by you,
but the source can't be reconstructed by others.


-Matt
-- 
Matt Stancliff                    San Jose, CA
@mattsta                  iPhone: 678-591-9337
"The best way to predict the future is to invent it." --Alan Kay



More information about the erlang-questions mailing list