2011-09-06 90 views
11

我與螺紋鋼和Erlang一般初學者產生的樣品二郎釋放。我試圖根據本教程創建一個帶有鋼筋的erlang版本:http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades,並且陷入了運行生成版本的地步。無法啓動與螺紋鋼

我的系統是從源代碼安裝的Ubuntu 11.04 64bit,erlang R14B03。

當我調用「斌/ 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」等 我猜Erlang是無法加載HIPE,但我不知道爲什麼試圖加載它擺在首位。該版本僅包含一個僅依賴於內核和stdlib的非常簡單的應用程序。

出於某種原因,螺紋鋼產生有很多不必要的應用程序.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}]}. 

爲什麼螺紋鋼列表中.rel文件洙許多應用?如果事情沒有問題,爲什麼不開始發佈?

回答

9

首先,你可以嘗試看看虛擬機的啓動期間所無法通過添加參數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> 

利用這一點,你就能夠看到更多的細節這種互動正在進行。這可能是庫被加載順序錯誤,你不支持原生等


第二期,包含了太多的應用程序版本文件。這可能是由於Rebar使用Reltool或生成版本的事實,並且可以根據控制生成版本時的細化程度(請參閱文檔中的incl_cond材料)加載不同的應用程序。這有幾個例子中的一些二郎瞭解您的Release is The Word章:

{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}]} 
]}. 

,這應該產生更小的版本。

+5

我剛添加{應用,HIPE,[{incl_cond,排除}]}到reltool.config和它的作品現在。感謝幫助。 – ghik

0

我不知道這個好的答案,但我確實知道我無法在幾個CentOS版本上運行一個發佈版本,但它們有幾個不同的內核,所以這並不罕見。升級到5.6使它終於工作。你可以看到它的操作系統實際上得到每天在這裏進行測試:

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

另外,你可以編譯沒有HIPE,我猜。

13

添加到reltool.config,下面一行:

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