无法启动使用 rebar 生成的示例 erlang 版本

发布于 2024-12-03 00:24:19 字数 1787 浏览 0 评论 0原文

一般来说,我是 rebar 和 erlang 的初学者。我试图根据本教程创建一个带有 rebar 的 erlang 版本: http://www.metabrew.com/article/erlang-rebar-tutorial-generate-releases-upgrades 并陷入运行生成版本的点。

我的系统是Ubuntu 11.04 64位,erlang R14B03,从源安装。

当我调用“bin/somenode console”时,出现以下错误之一:

Exec: /home/ghik/Inz/somerel/rel/somenode/erts-5.8.4/bin/erlexec -boot /home/ghik/Inz/somerel/rel/somenode/releases/1/somenode -mode embedded -config /home/ghik/Inz/somerel/rel/somenode/etc/app.config -args_file /home/ghik/Inz/somerel/rel/somenode/etc/vm.args -- console
Root: /home/ghik/Inz/somerel/rel/somenode
{"init terminating in do_boot",{'cannot load',hipe_amd64_encode,get_files}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()

有趣的是,每次运行它时,都会列出不同的原子而不是“hipe_amd64_encode”,例如:“hipe_amd64_defuse”、“hipe_amd64_assemble”等。 我猜 erlang 无法加载 hipe,但我不知道为什么首先要尝试加载它。该版本仅包含一个非常简单的应用程序,仅依赖于内核和 stdlib。

由于某种原因,rebar 生成了一个包含大量不必要应用程序的 .rel 文件:

%% rel generated at {2011,9,6} {20,5,48}
{release,{"somenode","1"},
     {erts,"5.8.4"},
     [{kernel,"2.14.4"},
      {stdlib,"1.17.4"},
      {sasl,"2.1.9.4"},
      {someapp,"1"},
      {compiler,"4.7.4",load},
      {crypto,"2.0.3",load},
      {et,"1.4.3",load},
      {gs,"1.5.13",load},
      {hipe,"3.8",load},
      {inets,"5.6",load},
      {mnesia,"4.4.19",load},
      {observer,"0.9.9",load},
      {public_key,"0.12",load},
      {runtime_tools,"1.8.5",load},
      {ssl,"4.1.5",load},
      {syntax_tools,"1.6.7.1",load},
      {tools,"2.6.6.4",load},
      {webtool,"0.8.8",load},
      {wx,"0.98.10",load}]}.

为什么 rebar 在 .rel 文件中列出了如此多的应用程序?如果没问题,为什么发布不开始?

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-tutorial-generating-releases-upgrades and got stuck at the point of running generated release.

My system is Ubuntu 11.04 64bit, erlang R14B03, installed from sources.

When i'm invoking 'bin/somenode console', I get one of the following errors:

Exec: /home/ghik/Inz/somerel/rel/somenode/erts-5.8.4/bin/erlexec -boot /home/ghik/Inz/somerel/rel/somenode/releases/1/somenode -mode embedded -config /home/ghik/Inz/somerel/rel/somenode/etc/app.config -args_file /home/ghik/Inz/somerel/rel/somenode/etc/vm.args -- console
Root: /home/ghik/Inz/somerel/rel/somenode
{"init terminating in do_boot",{'cannot load',hipe_amd64_encode,get_files}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()

Interestingly, each time I run it, different atom is listed instead of 'hipe_amd64_encode', for example: 'hipe_amd64_defuse', 'hipe_amd64_assemble', etc.
I'm guessing erlang is unable to load hipe, but I have no idea why is is trying to load it in the first place. The release contains only one, very simple application dependent only on kernel and stdlib.

For some reason, rebar generates a .rel file with lots of unnecessary applications:

%% rel generated at {2011,9,6} {20,5,48}
{release,{"somenode","1"},
     {erts,"5.8.4"},
     [{kernel,"2.14.4"},
      {stdlib,"1.17.4"},
      {sasl,"2.1.9.4"},
      {someapp,"1"},
      {compiler,"4.7.4",load},
      {crypto,"2.0.3",load},
      {et,"1.4.3",load},
      {gs,"1.5.13",load},
      {hipe,"3.8",load},
      {inets,"5.6",load},
      {mnesia,"4.4.19",load},
      {observer,"0.9.9",load},
      {public_key,"0.12",load},
      {runtime_tools,"1.8.5",load},
      {ssl,"4.1.5",load},
      {syntax_tools,"1.6.7.1",load},
      {tools,"2.6.6.4",load},
      {webtool,"0.8.8",load},
      {wx,"0.98.10",load}]}.

Why does rebar list soo many applications in the .rel file? And event if it's fine, why doesn't the release start?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

最近可好 2024-12-10 00:24:19

添加以下行到 reltool.config 中:

{app, hipe, [{incl_cond, exclude}]}

Add to reltool.config, the following line:

{app, hipe, [{incl_cond, exclude}]}
灼疼热情 2024-12-10 00:24:19

首先,您可以尝试通过向 VM 添加参数 init_debug 来查看 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>

使用此选项,您将能够更详细地查看交互类型正在进行中。可能是库以错误的顺序加载,您不支持本机等。


第二个问题,rel 文件包含太多应用程序。这可能是由于 Rebar 使用 Reltool 来生成版本,并且可以根据生成版本时控件的粒度来加载不同的应用程序(请参阅文档中的 incl_cond 材料)。 Learn You 的 Release is The Word 章节中有一些示例一些 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}]}
]}.

这应该会生成更小的版本。

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.

没︽人懂的悲伤 2024-12-10 00:24:19

我不知道好的答案,但我确实知道我无法启动在具有几个不同内核的多个 CentOS 版本上运行的版本,因此这并不罕见。升级到5.6终于可以用了。您可以在这里查看哪些操作系统实际上每天都经过测试:

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

另外,我猜你可以在没有 HIPE 的情况下进行编译。

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.

怀里藏娇 2024-12-10 00:24:19

最近我发现了这个帖子:
http://mokele.co.uk/2011/07 /01/rebar-release-upgrade-caveats.html

它揭示了 rebar 中的一系列错误,其中之一是我的版本无法启动的原因。还发布了修复程序。我希望它们能够尽快合并到主钢筋存储库中。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文