Rebar3 with LFE error

Hello everyone,

I am trying to use rebar3 with lfe, from the casting spels in lfe book.

I am getting this error when running the command.

$ rebar3 lfe repl
===> Verifying dependencies...
===> Compiling simple
===> Uncaught error in rebar_core. Run with DIAGNOSTIC=1 to see stacktrace or consult rebar3.crashdump
===> When submitting a bug report, please include the output of `rebar3 report "your command"

The rebar3.crashdump contains

Error: undef
[{rebar_app_utils,app_src_to_app,
                  ["/home/sqrt/DATA_2021/code/_LFE/casting-spels/code/_build/default/lib/simple",
                   "/home/sqrt/DATA_2021/code/_LFE/casting-spels/code/apps/simple/src/simple.app.src"],
                  []},
 {rebar3_lfe_utils,copy_app_src,1,
                   [{file,"/home/sqrt/DATA_2021/code/_LFE/casting-spels/code/_build/default/plugins/rebar3_lfe/src/rebar3_lfe_utils.erl"},
                    {line,35}]},
 {rebar3_lfe_prv_compile,compile_app,1,
                         [{file,"/home/sqrt/DATA_2021/code/_LFE/casting-spels/code/_build/default/plugins/rebar3_lfe/src/rebar3_lfe_prv_compile.erl"},
                          {line,59}]},
 {rebar3_lfe_prv_compile,'-compile/1-lc$^0/1-0-',1,
                         [{file,"/home/sqrt/DATA_2021/code/_LFE/casting-spels/code/_build/default/plugins/rebar3_lfe/src/rebar3_lfe_prv_compile.erl"},
                          {line,54}]},
 {rebar3_lfe_prv_compile,compile,1,
                         [{file,"/home/sqrt/DATA_2021/code/_LFE/casting-spels/code/_build/default/plugins/rebar3_lfe/src/rebar3_lfe_prv_compile.erl"},
                          {line,54}]},
 {rebar_core,do,2,
             [{file,"/tmp/rebar_build_RVMDk0/rebar3-3.16.1/src/rebar_core.erl"},
              {line,155}]},
 {rebar_prv_do,do_task,5,
               [{file,"/tmp/rebar_build_RVMDk0/rebar3-3.16.1/src/rebar_prv_do.erl"},
                {line,87}]},
 {rebar_core,do,2,
             [{file,"/tmp/rebar_build_RVMDk0/rebar3-3.16.1/src/rebar_core.erl"},
              {line,155}]}]

I can run lfe

$ lfe
Erlang/OTP 24 [erts-12.0.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

   ..-~.~_~---..
  (      \\     )    |   A Lisp-2+ on the Erlang VM
  |`-.._/_\\_.-':    |   Type (help) for usage info.
  |         g |_ \   |
  |        n    | |  |   Docs: http://docs.lfe.io/
  |       a    / /   |   Source: http://github.com/rvirding/lfe
   \     l    |_/    |
    \   r     /      |   LFE v1.2.1 (abort with ^G)
     `-E___.-'

lfe>

I suspect rebar3_lfe is not compatible with OTP 24, but I am not sure of the reason.

I am running
rebar 3.16.1 on Erlang/OTP 24 Erts 12.0.4 (installed with asdf)
on Ubuntu 20.04, with Erlang/OTP 24

What am I missing?

Thanks for taking time.

3 Likes

It looks like the version of rebar3_lfe your using is not compatible with rebar 3.16.1. rebar3_lfe is calling out to rebar_app_utils:app_src_to_app/2 but it is no longer defined in rebar3. Either the version of rebar3_lfe needs to be updated or a patch needs to be sent up to rebar3_lfe.

Edit:

Note I do remember debugging this with @oubiwann and I do remember a fix was formulated, but I do not remember if it was published :slight_smile:

Edit:

It works for me with rebar3_lfe v0.4.0 on both rebar3 3.16.1 and 3.17.0.

4 Likes

Thank You for the explanation. I am a rebar3 newbie.

3 Likes

Let us know if you upgrading resolves the issue :slight_smile:

3 Likes

Thank You,

Setting the rebar3_lfe version to “0.4.0” fixed the problem.

This is what I have now…

$ rebar3 lfe versions
(#(apps (#(my-test-lib git)))
 #(languages
   (#(lfe "2.0.1")
    #(erlang "24")
    #(emulator "12.0.4")
    #(driver_version "3.3")))
 #(tooling (#(rebar "3.16.1") #(rebar3_lfe "0.4.0"))))

Now I can test LFE and try to understand god-like macros :slight_smile:

4 Likes
6 Likes

The ultimate plot twist is we’re living in a simulation created by a 10 line Perl script.

4 Likes