Permalink
Browse files

Fix a problem with OTP release generation

Store erl_parse_erlc.beam and erl_parse_shell.beam in priv rather than ebin.
This way, those modules will not be included in .script file during release
generation. Otherwise, when these files are listed in .script file, Erlang
attempts to load them which causes system start to fail.
  • Loading branch information...
1 parent 792b222 commit 47c8f9e3ea71a222fb74ebac4fabfb05a3d070fa @alavrik committed Mar 2, 2012
Showing with 7 additions and 2 deletions.
  1. +2 −0 priv/.gitignore
  2. +4 −2 rebar.config
  3. +1 −0 src/erlson.erl
View
@@ -0,0 +1,2 @@
+erl_parse_erlc.beam
+erl_parse_shell.beam
View
@@ -15,8 +15,10 @@
{post_hooks, [
- {compile, "cp erlson_erlc/ebin/erl_parse.beam ebin/erl_parse_erlc.beam"},
- {compile, "cp erlson_shell/ebin/erl_parse.beam ebin/erl_parse_shell.beam"}
+ {compile, "cp erlson_erlc/ebin/erl_parse.beam priv/erl_parse_erlc.beam"},
+ {compile, "cp erlson_shell/ebin/erl_parse.beam priv/erl_parse_shell.beam"},
+
+ {clean, "rm -f priv/erl_parse_erlc.beam priv/erl_parse_shell.beam"}
]}.
View
@@ -326,6 +326,7 @@ init(Mod) ->
code:purge(erl_parse),
code:delete(erl_parse),
+ code:add_path(code:lib_dir(erlson, priv)),
case code:get_object_code(Mod) of
{_, Code, File} ->
code:unstick_dir(filename:dirname(File)),

0 comments on commit 47c8f9e

Please sign in to comment.