Skip to content

Commit

Permalink
Fix a problem with OTP release generation
Browse files Browse the repository at this point in the history
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
alavrik committed Mar 2, 2012
1 parent 792b222 commit 47c8f9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions priv/.gitignore
@@ -0,0 +1,2 @@
erl_parse_erlc.beam
erl_parse_shell.beam
6 changes: 4 additions & 2 deletions rebar.config
Expand Up @@ -15,8 +15,10 @@




{post_hooks, [ {post_hooks, [
{compile, "cp erlson_erlc/ebin/erl_parse.beam ebin/erl_parse_erlc.beam"}, {compile, "cp erlson_erlc/ebin/erl_parse.beam priv/erl_parse_erlc.beam"},
{compile, "cp erlson_shell/ebin/erl_parse.beam ebin/erl_parse_shell.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"}
]}. ]}.




Expand Down
1 change: 1 addition & 0 deletions src/erlson.erl
Expand Up @@ -326,6 +326,7 @@ init(Mod) ->
code:purge(erl_parse), code:purge(erl_parse),
code:delete(erl_parse), code:delete(erl_parse),


code:add_path(code:lib_dir(erlson, priv)),
case code:get_object_code(Mod) of case code:get_object_code(Mod) of
{_, Code, File} -> {_, Code, File} ->
code:unstick_dir(filename:dirname(File)), code:unstick_dir(filename:dirname(File)),
Expand Down

0 comments on commit 47c8f9e

Please sign in to comment.