Skip to content

Instantly share code, notes, and snippets.

@marianoguerra
Last active May 12, 2016 16:07
Show Gist options
  • Select an option

  • Save marianoguerra/5de8362a4ba92688315a8afcec4526ea to your computer and use it in GitHub Desktop.

Select an option

Save marianoguerra/5de8362a4ba92688315a8afcec4526ea to your computer and use it in GitHub Desktop.

when setting {include_src, false} on relx section on rebar.config and running:

rebar3 release

sources are included

when doing rebar3 as prod release

they are not

if {include_src, false} is not in relx section then they are included in the prod profile, it seems dev_mode overrides include_src or something in the default profile overrides it?

$ rebar3 new release myrel
===> Writing myrel/apps/myrel/src/myrel_app.erl
===> Writing myrel/apps/myrel/src/myrel_sup.erl
===> Writing myrel/apps/myrel/src/myrel.app.src
===> Writing myrel/rebar.config
===> Writing myrel/config/sys.config
===> Writing myrel/config/vm.args
===> Writing myrel/.gitignore
===> Writing myrel/LICENSE
===> Writing myrel/README.md
$ cd myrel
$ vim rebar.config # add {include_src, false} in relx section
$ rebar3 release
===> Verifying dependencies...
===> Compiling myrel
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
/home/mariano/tmp/myrel/_build/default/lib
/home/mariano/tmp/myrel/apps
/usr/lib/erlang/lib
===> Resolved myrel-0.1.0
===> Dev mode enabled, release will be symlinked
===> release successfully created!
$ rebar3 as prod release
===> Verifying dependencies...
===> Compiling myrel
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
/home/mariano/tmp/myrel/_build/prod/lib
/home/mariano/tmp/myrel/apps
/usr/lib/erlang/lib
===> Resolved myrel-0.1.0
===> Including Erts from /usr/lib/erlang
===> release successfully created!
$ ls _build/default/rel/myrel/lib/myrel-0.1.0
ebin include priv src
## NOTE: above in default profile src is included
$ ls _build/prod/rel/myrel/lib/myrel-0.1.0/
ebin
# REMOVE {include_src, false} option here
$ vim rebar.config
# start again
$ rm -rf _build/prod/rel _build/default/rel
$ rebar3 release
===> Verifying dependencies...
===> Compiling myrel
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
/home/mariano/tmp/myrel/_build/default/lib
/home/mariano/tmp/myrel/apps
/usr/lib/erlang/lib
===> Resolved myrel-0.1.0
===> Dev mode enabled, release will be symlinked
===> release successfully created!
$ rebar3 as prod release
===> Verifying dependencies...
===> Compiling myrel
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
/home/mariano/tmp/myrel/_build/prod/lib
/home/mariano/tmp/myrel/apps
/usr/lib/erlang/lib
===> Resolved myrel-0.1.0
===> Including Erts from /usr/lib/erlang
===> release successfully created!
$ ls _build/default/rel/myrel/lib/myrel-0.1.0
ebin include priv src
$ ls _build/prod/rel/myrel/lib/myrel-0.1.0
ebin src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment