[erlang-questions] Including other peoples code in my code in a future proof way

Fred Hebert mononcqc@REDACTED
Tue Mar 17 15:26:52 CET 2015

On 03/17, Loïc Hoguin wrote:
> I believe rebar3 has a way to lock dependencies into a specific commit for
> the projects that depend on another's "master".

Yes. It's done automatically when compiling, building releases, or any
other command that depends on compiled modules being there (an explicit
`rebar3 lock' command can be run too).


Another answer that Joe might want is the possibility of using releases.
Whether it's with systools, reltool, relx (possibly via erlang.mk or
rebar3), releases allow you to ship an Erlang program with its minimal
version of the Erlang VM, with the code pre-compiled.

This at least removes the requirement that the user has Erlang or make
installed, and makes it so Joe (or the release creator) used a similar
runtime system to compile the application, or took specific steps to

Releases also have the option to ship without stdlibs or the ERTS in
case you want them to run on a target system with an existing copy of
Erlang in there.

If the code uses no NIFs, such portable releases are really the best way
to go about distributing Erlang code.

The big constraint is that you must write OTP applications for these to
work, which I know Joe sometimes likes not to do (a supervisor bridge
may help such cases: http://www.erlang.org/doc/man/supervisor_bridge.html


More information about the erlang-questions mailing list