1

After some years I'd like to back working with Erlang/LFE. I've a little project I made to learn the language. I'm unable to fetch dependencies using rebar3 get-deps command.

It follows rebar.config, also available 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"}}}
  ]}.

I know that I've referenced an old version of LFE... But if I remove all deps and try to add them again: the first that fails is clj. However with rebar.config in its original state, I got the following output after rebar3 get-deps. Complete output 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"}

I checked a similar question and documentation, but I was still unable to fix the problem.

My system is macOS Catalina. It follows Erlang environment versions: ERLANG 22.2.1, LFE 1.3, REBAR3 3.12.0.

All installed with brew. Please let me know if more details are needed.

I would really appreciate any help.

gsscoder
  • 3,088
  • 4
  • 33
  • 49
  • I am positive this is the issue induced by that you use untagged `master` git sources everywhere. I would start with setting all the versions to last values explicitly, one by one. `rebar` is not a magician, help it. – Aleksei Matiushkin Dec 22 '19 at 16:15
  • @AlekseiMatiushkin thanks for suggestion but It's something I've already tried... Anyway I tried again and didn't work. I've removed `master` and other `tag`s. But `rebar3` stil complains about `ljson`: `Failed to fetch and copy...`. Tried also `rebar3 clean`. There's other I can try? – gsscoder Dec 22 '19 at 17:34

1 Answers1

2

I finally discovered that referencing lfe/clj and lfe/lhc is redudant, since these packages are indirectly and correctly referenced in implicit way from other ones.

I've removed these from rebar.config, updated to latest syntax and used tag when possible (otherwise master). I switched all URLs to use https:// instead of SSH with scheme git://.

Now I'm able to get dependencies with rebar3 get-deps and compile with rebar3 compile.

Updated 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"}}}
  ]}.
gsscoder
  • 3,088
  • 4
  • 33
  • 49