gpt4 book ai didi

erlang - 使用rebar释放时如何处理deps?

转载 作者:行者123 更新时间:2023-12-04 23:55:11 24 4
gpt4 key购买 nike

我正在使用 rebar generate处理释放,但是当我开始
应用程序,我使用的 deps 将找不到。`

我可以使用 erl -pa ./ebin ./deps/*/ebin -s myapp 手动启动应用程序.

我想知道如何配置 rebar.configreltool.config处理
依赖?谢谢。

最佳答案

为了让 reltool 生成包含依赖项的版本,您需要将它们添加到 reltool.config .我有一个名为 drill_instructor 的应用程序,其中有以下 reltool.config .像 {app, stdlib, [{incl_cond, include}]}, 这样的行告诉 reltool 在发布中包含该应用程序。我还将 deps 添加到 the lib_dirs环境。

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

{target_dir, "drill_instructor"}.

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

在 rebar.config 中,我还添加了 rel 作为 sub_dir :
{sub_dirs, ["rel"]}.

关于erlang - 使用rebar释放时如何处理deps?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17482732/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com