Rebarで生成されたErlangリリースのサンプルを開始できません

StackOverflow https://stackoverflow.com/questions/7324556

  •  27-10-2019
  •  | 
  •  

質問

私は一般的に鉄筋とエルランの初心者です。このチュートリアルに従って、Rebarを使用してErlangリリースを作成しようとしていました。 http://www.metabrew.com/article/erlang-rebar-tutorial-generating releases-upgrades 実行されたリリースを実行するポイントで立ち往生しました。

私のシステムは、ソースからインストールされているUbuntu 11.04 64ビット、Erlang R14B03です。

「bin/somenodeコンソール」を呼び出しているとき、次のエラーのいずれかを取得します。

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'など。そもそもロードしようとしています。このリリースには、カーネルとstdlibにのみ依存する非常に単純なアプリケーションが1つだけ含まれています。

何らかの理由で、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ファイルに多くのアプリケーションがSOOをリストするのはなぜですか?そして、それが問題ない場合、なぜリリースが開始されないのですか?

役に立ちましたか?

解決

まず第一に、引数を追加することにより、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>

これを使用すると、詳細を確認できるようになります。ライブラリが間違った順序でロードされており、ネイティブなどをサポートしていない可能性があります。


2番目の問題、あまりにも多くのアプリケーションを含むRELファイル。これは、RebarがRelTool OT生成リリースを使用しているため、リリースの生成がどのようにコントロールが粒状かによって異なるアプリケーションをロードできるという事実による可能性があります(参照 incl_cond ドキュメント内の資料)。これにはいくつかの例があります リリースは言葉です 学習の章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}]}
]}.

そして、これにより小さなリリースが生成されるはずです。

他のヒント

追加 reltool.config, 、次の行:

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

良い答えはわかりませんが、いくつかの異なるカーネルを備えたいくつかのCentosバージョンで実行されているリリースを開始できないことを知っています。これはまったく珍しいことではありません。 5.6にアップグレードすると、最終的に機能しました。ここでは、どのOSが実際に毎日テストされているかを確認できます。

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

また、HIPEなしでコンパイルすることもできます。

最近、私はこの投稿を見つけました:http://mokele.co.uk/2011/07/01/rebar-release-pgrade-caveats.html

Rebarのエラーのリストが明らかになりました。そのうちの1つは、私のリリースが起動できなかった理由です。公開された修正もあります。彼らができるだけ早くメインの鉄筋リポジトリに統合されることを願っています。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top