【问题标题】:rebar3 fails to fetch and copy dependencies (LFE project)rebar3 无法获取和复制依赖项(LFE 项目)
【发布时间】:2019-12-22 15:14:00
【问题描述】:

几年后我想回到 Erlang/LFE 工作。我有一个 little project 来学习这门语言。我无法使用rebar3 get-deps 命令获取依赖项。

它遵循rebar.config,也可以使用here

{erl_opts, [debug_info, {src_dirs, ["test"]}]}.
{lfe_first_files, []}.
{deps_dir, ["deps"]}.
{eunit_compile_opts, [
   {src_dirs, ["test"]}
  ]}.
{deps, [
   {lfe, "0.9.0", {git, "git://github.com/rvirding/lfe.git", {tag, "v0.9.0"}}},
   {clj, ".*", {git, "git://github.com/lfex/clj.git"}},
   {lhc, ".*", {git, "git://github.com/lfex/lhc.git"}},
   {ljson, ".*", {git, "git@github.com:lfex/ljson.git", "master"}}, 
   {ltest, ".*", {git, "git://github.com/lfex/ltest.git", {tag, "0.4.1"}}}
  ]}.

我知道我引用了旧版本的 LFE...但是如果我删除所有 dep 并尝试再次添加它们:第一个失败的是 clj。然而,rebar.config 处于原始状态,我在rebar3 get-deps 之后得到了以下输出。完成输出here

===> Verifying dependencies...
===> Fetching clj (from {git,"git://github.com/lfex/clj.git"})
===> WARNING: It is recommended to use {branch, Name}, {tag, Tag} or {ref, Ref}, otherwise updating the dep may not work as expected.
===> Fetching lfe-compile (from {git,"https://github.com/lfe-rebar3/compile.git",
                       {tag,"0.5.0"}})
===> Fetching lfe (from {git,"https://github.com/rvirding/lfe.git",
               {ref,"697e9b4996fa843f4c6a9edea25005d30a9b8a14"}})
===> Compiling lfe
...
===> Compiling ltest
 ~~>    Finding .lfe files ...
 ~~>    Compiling ./_build/default/plugins/ltest/src/ltest.lfe ...
 ~~>    Compiling ./_build/default/plugins/ltest/src/ltest-const.lfe ...
 ~~>    Compiling ./_build/default/plugins/ltest/src/ltest-formatter.lfe ...
 ~~>    Compiling ./_build/default/plugins/ltest/src/ltest-unit.lfe ...
 ~~>    Compiling ./_build/default/plugins/ltest/src/ltest-runner.lfe ...
===> Plugin {'lfe-test',{git,"https://github.com/lfe-rebar3/test.git",
                                    {tag,"0.4.0-rc2"}}} not available. It will not be used.
===> Fetching lfe-clean (from {git,"https://github.com/lfe-rebar3/clean.git",
                     {tag,"0.4.0-rc2"}})
===> Compiling lfe-clean
 ~~>    Finding .lfe files ...
 ~~>    Compiling ./_build/default/plugins/lfe-clean/src/lr3-cln-util.lfe ...
===> Plugin {'lfe-clean',{git,"https://github.com/lfe-rebar3/clean.git",
                                     {tag,"0.4.0-rc2"}}} not available. It will not be used.
===> Fetching ljson (from {git,"git@github.com:lfex/ljson.git","master"})
===> WARNING: It is recommended to use {branch, Name}, {tag, Tag} or {ref, Ref}, otherwise updating the dep may not work as expected.
===> Failed to fetch and copy dep: {git,"git@github.com:lfex/ljson.git","master"}

我检查了similar questiondocumentation,但仍然无法解决问题。

我的系统是 ma​​cOS Catalina。它遵循 Erlang 环境版本: ERLANG 22.2.1,LFE 1.3,REBAR3 3.12.0。

全部使用brew 安装。如果需要更多详细信息,请告诉我。

非常感谢任何帮助。

【问题讨论】:

  • 我很肯定这是由于您在任何地方都使用未标记的master git 源引起的问题。我将首先将所有版本明确地设置为最后一个值。 rebar不是魔术师,救命。
  • @AlekseiMatiushkin 感谢您的建议,但这是我已经尝试过的东西......无论如何我再次尝试并没有工作。我删除了master 和其他tags。但是rebar3 仍然抱怨ljsonFailed to fetch and copy...。也试过rebar3 clean。还有其他我可以尝试的吗?

标签: erlang rebar3 lfe


【解决方案1】:

我终于发现引用lfe/cljlfe/lhc 是多余的,因为这些包被其他包以隐式方式间接且正确地引用。

我已将这些从 rebar.config 中删除,更新为最新语法并尽可能使用tag(否则master)。我将所有 URL 切换为使用 https:// 而不是 SSH 和方案 git://

现在我可以使用 rebar3 get-deps 获取依赖项并使用 rebar3 compile 进行编译。

更新了 rebar.config

{erl_opts, [debug_info, {src_dirs, ["test"]}]}.
{lfe_first_files, []}.
{deps_dir, ["deps"]}.
{eunit_compile_opts, [
   {src_dirs, ["test"]}
  ]}.
{deps, [
   {lfe, {git, "https://github.com/rvirding/lfe.git", {"tag", "v1.3"}}},
   {ljson, {git, "https://github.com/lfex/ljson.git", "master"}},
   {ltest, {git, "https://github.com/lfex/ltest.git", {tag, "0.9.0"}}}
  ]}.

【讨论】:

    猜你喜欢
    • 2019-09-02
    • 2010-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-06
    • 1970-01-01
    • 2012-03-30
    • 2019-08-12
    相关资源
    最近更新 更多