“rebar生成”在生成的版本中不包含一些依赖项

问题描述 投票:0回答:1

我在使用 rebar 构建我正在开发的 erlang 应用程序版本时遇到了一个奇怪的问题。本质上,它似乎无法找到安装在我的系统上的 erlang thrift 客户端。我可以通过从 erlang 提示符加载 thrift 应用程序来验证这一点:

$ erl
Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false]

Eshell V5.8.5  (abort with ^G)
1> application:load(thrift).
ok
2> application:loaded_applications().
[{kernel,"ERTS  CXC 138 10","2.14.5"},
 {thrift,"Thrift bindings","0.9.0-dev"},
 {stdlib,"ERTS  CXC 138 10","1.17.5"}]
3> 

但是,当我尝试运行“rebar generated”来构建应用程序的版本时,它失败了:

$ rebar generate
==> rel (generate)
{"init terminating in do_boot","Release fern uses non existing application thrift"}

Crash dump was written to: erl_crash.dump
init terminating in do_boot (Release fern uses non existing application thrift)

这是我的应用程序文件,fern.app.src:

{application, fern, [
  {description, "elided"},
  {vsn, "0.5.0"},
  {modules, [
    fern_app,
    fern_sup,
    accounts_repository,
    fern_http_request,
    fern_system_api,
    metadata_fetcher,
    metadata_process,
    repository,
    repository_server,
    timestamps_repository,
    hbase_thrift,
    hbase_types,
    utils
  ]},
  {registered, [
    fern_sup
  ]},
  {applications, [
    kernel,
    stdlib,
    inets,
    ssl 
  ]},
  {mod, { fern_app, []}},
  {env, []},
  {agner, [
    {requires, ["jiffy", "meck", "mochiweb"]}
  ]}
]}.

...和我的reltool.config:

{sys, [
       {lib_dirs, ["../apps", "../deps"]},
       {erts, [{mod_cond, derived}, {app_file, strip}]},
       {app_file, strip},
       {rel, "fern", "1",
        [
         kernel,
         stdlib,
         sasl,
         ssl,
         inets,
         thrift,
         fern
        ]},
       {rel, "start_clean", "",
        [
         kernel,
         stdlib
        ]},
       {boot_rel, "fern"},
       {profile, embedded},
       {incl_cond, exclude},
       {excl_archive_filters, [".*"]}, %% Do not archive built libs
       {excl_sys_filters, ["^bin/.*", "^erts.*/doc", "^erts.*/src",
                           "^erts.*/info", "^erts.*/man",
                           "^erts.*/lib", "^erts.*/include",
                           "^erts.*/bin/(dialyzer|typer)"]},
       {excl_app_filters, ["\.gitignore"]},
       {app, sasl,   [{incl_cond, include}]},
       {app, stdlib, [{incl_cond, include}]},
       {app, kernel, [{incl_cond, include}]},
       {app, inets,  [{incl_cond, include}]},
       {app, crypto, [{incl_cond, include}]},
       {app, public_key, [{incl_cond, include}]},
       {app, ssl,    [{incl_cond, include}]},
       {app, thrift, [{incl_cond, include}]},
       {app, fern, [{incl_cond, include}]}
      ]}.

{target_dir, "fern"}.

{overlay, [
           {mkdir, "log/sasl"},
           {copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
           {copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
           {copy, "files/fern", "bin/fern"},
           {copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
           {copy, "files/fern.cmd", "bin/fern.cmd"},
           {copy, "files/start_erl.cmd", "bin/start_erl.cmd"},
           {copy, "files/vm.args", "releases/\{\{rel_vsn\}\}/vm.args"}
          ]}.

我应该注意,如果我从两个应用程序列表中删除 thrift,则会生成版本,但不包含 thrift 库,因此在运行时失败。有人能为我提供有关我在这里做错的事情的指导吗?

非常感谢,

蒂姆

erlang rebar
1个回答
4
投票

[`我已经从堆栈溢出中删除了所有答案,因为我不想为提取性、剥削性、“人工智能”服务的培训做出贡献。抱歉。]

© www.soinside.com 2019 - 2024. All rights reserved.