# Is it possible to build erlang with rebar3 without offering the erlang run time?

**URL:** <https://erlangforums.com/t/is-it-possible-to-build-erlang-with-rebar3-without-offering-the-erlang-run-time/5346>\
**Category:** Questions / Help\
**Tags:** build-tool, rebar3, compile\
**Created:** [December 31, 2025, 5:07pm UTC](https://erlangforums.com/t/is-it-possible-to-build-erlang-with-rebar3-without-offering-the-erlang-run-time/5346 "2025-12-31T17:07:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![omar](https://erlangforums.com/user_avatar/erlangforums.com/omar/32/3096_2.png) [@omar](https://erlangforums.com/u/omar)\
**Post date:** [December 31, 2025, 5:07pm UTC](https://erlangforums.com/t/is-it-possible-to-build-erlang-with-rebar3-without-offering-the-erlang-run-time/5346/1 "2025-12-31T17:07:35Z")

</div>

Hey guys.

Beginner in erlang here.

I was wondering if it is possible to use rebar3 in a way that the machine having the tool built in erlang, wouldn’t be able to run something like “console” and obtain information about the modules that are included in the tool.

For example, one of the erlang books had something like this to run the compiled version of the program:  
`_build/default/rel/module_name/bin/module_name console`

And through this command, you would have a running erlang shell, where you would be able to execute something like; `application:get_applications()`

Can we use rebar3 to build an erlang program where the user of this program wouldn’t be able to obtain any information about the sensitive business parts in the source code?

---

<div class="post-metadata">

**Author:** ![ieQu1](https://erlangforums.com/user_avatar/erlangforums.com/iequ1/32/2633_2.png) [@ieQu1](https://erlangforums.com/u/ieQu1)\
**Post date:** [December 31, 2025, 9:34pm UTC](https://erlangforums.com/t/is-it-possible-to-build-erlang-with-rebar3-without-offering-the-erlang-run-time/5346/2 "2025-12-31T21:34:23Z")

</div>

> And through this command, you would have a running erlang shell, where you would be able to execute something like; `application:get_applications()`

Regardless of build system used, rebar3 or otherwise, the answer is no: you cannot reliably hide OTP applications or modules used in the release. Any build system produces a directory structured according to the [OTP appliction standard](https://www.erlang.org/doc/system/applications.html#directory-structure-for-a-released-system). It isn’t even necessary to run any code in the console to find what OTP applications or modules are used in the release; it’s enough to inspect the files on disk. One module corresponds to one `.beam` file, and one application corresponds to one `.app` file.

Moreover, since Erlang supports `apply(ModuleName, FunctionName, Args)` call-style, so all module names and exported function names are kept in memory, allowing curious observer to dump memory of BEAM process and inspect the corresponding tables.

Your best chance at hiding the “sensitive business parts” is to use `encrypt_debug_info` compiler option. That is, honestly, enough for your typical proprietry code that doesn’t try to hide GPL violations.

---

<div class="post-metadata">

**Author:** ![vances](https://erlangforums.com/user_avatar/erlangforums.com/vances/32/710_2.png) [@vances](https://erlangforums.com/u/vances)\
**Post date:** [January 1, 2026, 5:48am UTC](https://erlangforums.com/t/is-it-possible-to-build-erlang-with-rebar3-without-offering-the-erlang-run-time/5346/3 "2026-01-01T05:48:22Z")

</div>

Given your concern, you’ll be interested to know that it **MAY** be possible to extract the source code from a BEAM file!

[Reconstruct Source Code](https://www.erlang.org/docs/28/apps/stdlib/beam_lib.html#module-reconstruct-source-code)

```erlang
1> {ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(code:which(gen_server),[abstract_code]),
2> io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]).
-file("gen_server.erl", 1).

-module(gen_server).
...

```

… however you’ll be happy to know that you have to explicitly enable it. 😉

---

<div class="post-metadata">

**Author:** ![uwiger](https://erlangforums.com/user_avatar/erlangforums.com/uwiger/32/274_2.png) [@uwiger](https://erlangforums.com/u/uwiger)\
**Post date:** [January 1, 2026, 9:39am UTC](https://erlangforums.com/t/is-it-possible-to-build-erlang-with-rebar3-without-offering-the-erlang-run-time/5346/4 "2026-01-01T09:39:19Z")

</div>

If you’re a regular `parse_trans` user, it might be useful to know that the `parse_trans_pp` module automates this:

```erlang
uwmbp:parse_trans uwiger$ escript _build/default/lib/parse_trans/ebin/parse_trans_pp.beam _build/default/lib/parse_trans/ebin/exprecs.beam | head -20
-file("/Users/uwiger/uw/parse_trans/src/exprecs.erl", 1).
-module(exprecs).
-export([parse_transform/2,format_error/1,context/2]).
-record(context,{module, function, arity}).
-record(pass1,{exports = [],
generated = false,
records = [],
record_types = [],
versions = orddict:new(),
inserted = false,
prefix = ["#", operation, "-"],
fname = [prefix, record],
vfname = [fname, "__", version]}).
-file("/Users/uwiger/uw/parse_trans/src/../include/codegen.hrl", 1).
-file("/Users/uwiger/uw/parse_trans/src/exprecs.erl", 648).
-type form() :: any().
-type forms() :: [form()].
-type options() :: [{atom(), any()}].
get_pos(I) ->
case proplists:get_value(form, I) of

```

BR,  
Ulf W
