Cannot start sample erlang release generated with rebar

前端 未结 4 1483
忘了有多久
忘了有多久 2021-01-31 06:36

I\'m a beginner with rebar and erlang generally. I was trying to create an erlang release with rebar according to this tutorial: http://www.metabrew.com/article/erlang-rebar-tut

相关标签:
4条回答
  • 2021-01-31 07:00

    Add to reltool.config, the following line:

    {app, hipe, [{incl_cond, exclude}]}
    
    0 讨论(0)
  • 2021-01-31 07:04

    Lately I found this post: http://mokele.co.uk/2011/07/01/rebar-release-upgrade-caveats.html

    It uncovers a list of errors in rebar, one of them being the reason why my release couldn't launch. There are also fixes published. I hope they will be merged into main rebar repository ASAP.

    0 讨论(0)
  • 2021-01-31 07:12

    I don't know the good answer, but I do know that I couldn't start a release running on several CentOS versions with a couple different kernels, so this isn't exactly unusual. Upgrading to 5.6 made it finally work. You can see which OSes actually get tested every day here:

    http://www.erlang.org/doc/installation_guide/INSTALL.html#id62915

    Also, you could compile without HIPE, I guess.

    0 讨论(0)
  • 2021-01-31 07:14

    First of all, you can try to see what fails during the booting of the VM by adding the arguments init_debug to the VM:

    $ erl -init_debug
    {progress,preloaded}
    {progress,kernel_load_completed}
    {progress,modules_loaded}
    {start,heart}
    {start,error_logger}
    {start,application_controller}
    {progress,init_kernel_started}
    ...
    {progress,applications_loaded}
    {apply,{application,start_boot,[kernel,permanent]}}
    {apply,{application,start_boot,[stdlib,permanent]}}
    {apply,{c,erlangrc,[]}}
    {progress,started}
    Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]
    
    Eshell V5.8.4  (abort with ^G)
    1>
    

    Using this, you'll be able to see with more details the kind of interactions going on. It might be that libraries are being loaded in the wrong order, you don't support native, etc.


    Second issue, the rel file containing too many applications. This is likely due to the fact that Rebar uses Reltool ot generate releases, and that different applications can be loaded depending on how granular the control is whne generating releases (see incl_cond material in the docs). There are a few examples for this in the Release is The Word chapter of Learn You Some Erlang:

    {sys, [
     {lib_dirs, ["/home/ferd/code/learn-you-some-erlang/release/"]},
     {erts, [{mod_cond, derived}, % derived makes it pick less stuff
             {app_file, strip}]},
     {rel, "erlcount", "1.0.0", [kernel, stdlib, ppool, erlcount]},
     {boot_rel, "erlcount"},
     {relocatable, true},
     {profile, embedded}, % reduces the files included from each app
     {app_file, strip}, % reduces the size of app files if possible
     {incl_cond, exclude}, % by default, don't include apps. 'derived' is another option
     {app, stdlib, [{mod_cond, derived}, {incl_cond, include}]}, % include at the app
     {app, kernel, [{incl_cond, include}]},                      % level overrides the
     {app, ppool, [{vsn, "1.0.0"}, {incl_cond, include}]},       % exclude put earlier
     {app, erlcount, [{vsn, "1.0.0"}, {incl_cond, include}]}
    ]}.
    

    And this should generate smaller releases.

    0 讨论(0)
提交回复
热议问题