标签: rebar

Erlang和Elixir的包管理

我搜索package managementErlangElixir并得到了一些指针rebar rebar3 mix hexrelx等,您可以帮助澄清它们之间的关系?哪里用什么?难道package只是同义词Erlang的application组成的modules

erlang elixir-mix elixir rebar relx

25
推荐指数
1
解决办法
2291
查看次数

有没有办法告诉rebar不要运行依赖项的eunit测试?

运行时:

./rebar eunit
Run Code Online (Sandbox Code Playgroud)

测试也针对外部依赖项运行.有没有办法改变这种行为?也许通过rebar.config文件?

erlang rebar

20
推荐指数
1
解决办法
4439
查看次数

在Erlang shell中加载项目的Rebar依赖项的简便方法

我有一个使用Rebar作为构建工具的项目.在开发时,我希望尽可能简单地在shell中编译和加载Rebar.config中指定的所有应用程序依赖项.我在Emacs中使用Erlang shell.什么是快速的方法呢?

erlang rebar

16
推荐指数
2
解决办法
3417
查看次数

如何在Windows 8中安装,编译和使用Rebar

这可能吗?

我遇到的关于如何构建和使用Rebar的所有教程都涉及到Unix命令,而且我是一个非常不幸的Windows用户.如果我能帮忙的话,我真的很想避免安装Cygwin.

例如,要构建Rebar,您将获得:

$ git clone git://github.com/rebar/rebar.git
$ cd rebar
$ ./bootstrap
Recompile: src/getopt
...
Recompile: src/rebar_utils
==> rebar (compile)
Congratulations! You now have a self-contained script called "rebar" in
your current working directory. Place this script anywhere in your path
and you can use rebar to build OTP-compliant apps.
Run Code Online (Sandbox Code Playgroud)

什么是windows-cmd等价物?

下面的任何链接或教程提供有关如何在Windows shell中使用钢筋的分步说明将非常感激.

更新:

手动下载并将Rebar解压缩到我的目录后,位于:C:\ erlang\rebar

我转到windows shell并输入:

SET PATH=C:\Program Files\erl5.10.1\bin
Run Code Online (Sandbox Code Playgroud)

这是位于包含erlang.exe的目录内的'bin'文件夹

接下来我输入:

C:\erlang\rebar>bootstrap.bat 
Run Code Online (Sandbox Code Playgroud)

编译了!:)

windows erlang rebar

15
推荐指数
1
解决办法
9887
查看次数

如何运行erlang(rebar build)应用程序

我是Erlang世界的新手,目前无法弄清楚如何启动我的虚拟erlang应用程序.可能,我只是遗漏了一些东西......所以,我用rebar创建了一个应用程序(rebar create-app appid = dummys).

目前我有

  • rebar.config
  • SRC/dummys.app.src
  • SRC/dummys_app.erl
  • SRC/dummys_sup.erl

我发现为了在开发期间运行应用程序,最好创建一个应该调用application:start(module)的额外start方法.

我在启动方法中添加了一些基本的日志记录.

start() ->
    error_logger:info_msg("Starting app(dev)..~n"),
    application:start(dummys_app).

start(_StartType, _StartArgs) ->
    error_logger:info_msg("Starting app..~n"),
    dummys_sup:start_link().
Run Code Online (Sandbox Code Playgroud)

如果我试试

erl -noshell -pa ebin -s application start dummys
erl -noshell -pa ebin -s application start dummys_app
Run Code Online (Sandbox Code Playgroud)

没有输出..

如果我试试

erl -noshell -pa ebin -s dummys start
Run Code Online (Sandbox Code Playgroud)

erl因错误而崩溃..

如果我试试

erl -noshell -pa ebin -s dummys_app start
Run Code Online (Sandbox Code Playgroud)

它输出的只是" 启动应用程序(开发)... "而这就是全部.但我也希望看到"正在开始使用.. "

我错过了什么或做错了什么?

=============

另一个问题:如何正确地向我的虚拟应用程序添加新模块?例如,我有一个名为"*dummys_cool*"的附加模块,它有一个" 开始 "方法.如何告诉我的应用程序运行"dummys_cool #start"方法?

谢谢!

erlang rebar

14
推荐指数
1
解决办法
1万
查看次数

螺纹钢和螺纹钢3有什么区别?或者erlang.mk

我是Erlang编程语言的新手.Erlang中是否有标准的构建工具?

我已经搜索了这些,不知道我应该使用哪一个.我不知道它用于什么样的场合?

erlang rebar

14
推荐指数
1
解决办法
2086
查看次数

无法启动使用钢筋生成的样本erlang版本

我一般都是钢筋和二郎的初学者.我试图根据本教程创建一个带有钢筋的erlang版本:http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades并且在运行生成的版本时陷入困境.

我的系统是Ubuntu 11.04 64bit,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 ()
Run Code Online (Sandbox Code Playgroud)

有趣的是,每次运行它时,都会列出不同的原子而不是'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}]}.
Run Code Online (Sandbox Code Playgroud)

为什么rebar列表会在.rel文件中列出很多应用程序?事件如果没问题,为什么不发布?

erlang hipe rebar

11
推荐指数
2
解决办法
5153
查看次数

命令'生成'不被理解或不适用

我正在尝试运行rebar generate来为erlang钢筋项目生成一个版本并获得以下错误.我有什么想法我做错了吗?

./rebar generate
Command 'generate' not understood or not applicable
Run Code Online (Sandbox Code Playgroud)

我在OSX上使用erlang版本的Erlang R14B03,下面是我的rebar.conf

{lib_dirs, ["deps"]}.
{sub_dirs, ["rel"]}.
{deps, [
       {folsom, ".*", {git, "git://github.com/boundary/folsom", "master"}}
       ]}.

{require_otp_vsn, "R14|R15"}.

{erl_opts, [
            fail_on_warning, 
            debug_info, 
            warn_missing_spec
       ]}.

{clean_files, ["*.eunit", "ebin/*.beam", "rel/graphsom"]}.

{cover_enabled, true}.

{eunit_opts, [verbose, {report, {eunit_surefire, [{dir, "."}]}}]}.
Run Code Online (Sandbox Code Playgroud)

erlang rebar

11
推荐指数
1
解决办法
2562
查看次数

用Erchi编写的命令行工具的惯用方法

问题

关于Erlang的大多数文章和书籍都可以找到专注于创建长期运行的类似服务器的应用程序,而不会覆盖命令行工具创建的过程.

我有一个包含3个应用程序的多应用程序rebar3项目:

  • myweb- cowboy基于Web的服务;
  • mycli- 准备资产的命令行工具myweb;
  • mylib-使用两个图书馆mywebmycli,取决于NIF.

由于构建我想得到这样的工件:

  1. 要为http请求提供服务的Web部件的可执行文件;
  2. 用于资产准备的可执行命令行工具;
  3. 上面使用的一组库.

要求

  • cli应该像一个理智的非交互式命令行工具:处理参数,处理stdin/stdout,出错时返回非零退出代码等;
  • 服务器和cli都应该能够使用NIF;
  • 应该很容易将工件打包为一组deb/rpm包,因此服务器和cli都应该重用公共依赖项.

到目前为止尝试的事情

建立一个escript

我在野外看到的方法之一是创建一个自包含的escript文件.至少rebar并且relx这样做.所以我试一试.

优点:

  • 支持命令行参数;
  • 如果出现错误,则返回非零退出代码.

缺点:

  • 将所有依赖项嵌入到单个文件中,使其无法重用mylib;
  • 由于*.so文件嵌入到生成的escript文件中,因此无法在运行时加载,因此NIF不起作用(参见erlang rebar escriptize&nifs);
  • rebar3 escriptize不能很好地处理依赖关系(参见bug 1139).

未知数:

  • 应该cli应用程序成为适当的OTP应用程序;
  • 它应该有一个监督树;
  • 它应该开始吗?
  • 如果是这样,我怎样在资产处理后停止它?

建立一个版本

构建命令行工具的另一种方法在Fred Hebert 的How I start:Erlang文章中有所描述.

优点:

  • 每个依赖项应用程序都进入它们自己的目录,这样就可以轻松地共享和打包它们.

缺点:

  • 没有像escript那样定义的入口点main/1;
  • 因此,必须手动处理命令行参数和退出代码.

未知数:

  • 如何以非交互方式建模cli OTP应用程序;
  • 如何在处理资产时停止应用程序?

上述两种方法似乎都不适合我. …

erlang rebar

11
推荐指数
1
解决办法
655
查看次数

erlang rebar escriptize&nifs

如果我自己编写escript,我可以使用nif,但是当我使用rebar escriptize时,无法找到nif函数.我认为这是因为*.so对象没有像束文件那样被打包.这是一个简单的例子;

rebar.config:

{deps, [
   {'jiffy', "", {git, "https://github.com/davisp/jiffy.git", {branch, master}}}
]}.
{escript_incl_apps, [jiffy]}.
%% I tried this to see what happens if the so got in there but didn't help
{escript_incl_extra, [{"deps/jiffy/priv/jiffy.so", "/path/to/my/proj"}]}.
Run Code Online (Sandbox Code Playgroud)

test.erl:

-module(test).

-export([main/1]).

main(_Args) ->
    jiffy:decode(<<"1">>),
    ok.
Run Code Online (Sandbox Code Playgroud)


rebar get-deps compile escriptize ./test

结果是

escript: exception error: undefined function jiffy:decode/1
  in function  test:main/1 (src/test.erl, line 7)
  in call from escript:run/2 (escript.erl, line 741)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_it/1
  in …
Run Code Online (Sandbox Code Playgroud)

erlang rebar erlang-nif

10
推荐指数
1
解决办法
1846
查看次数

标签 统计

erlang ×10

rebar ×10

elixir ×1

elixir-mix ×1

erlang-nif ×1

hipe ×1

relx ×1

windows ×1