Rebar3 LFE plugin REPL fails to run after building a new project with rebar3

69 views
Skip to first unread message

Sasha Fonseca

unread,
Dec 22, 2016, 6:28:49 PM12/22/16
to Lisp Flavoured Erlang
So I'm still experimenting with LFE and I've been following this page to setup a proper LFE project with rebar3. I've installed rebar3 created a new release and added some LFE plugins and a dependency to the project:

{erl_opts, [debug_info]}.


{plugins, [
 
{'lfe-compile', "0.7.0", {pkg, rebar3_lfe_compile}},
       
{'lfe-repl', {git, "https://github.com/lfe-rebar3/repl.git", {tag, "0.2.1"}}}
]}.


{deps, [
       
{hackney, ".*", {git, "git://github.com/benoitc/hackney.git", {branch, "master"}}}
]}.


{relx, [{release, { test, "0.1.0" },
         
[test,
          sasl
]},


       
{sys_config, "./config/sys.config"},
       
{vm_args, "./config/vm.args"},


       
{dev_mode, true},
       
{include_erts, false},


       
{extended_start_script, true}]
}.


{profiles, [{prod, [{relx, [{dev_mode, false},
                           
{include_erts, true}]}]
           
}]
}.

And then I've tried to run a REPL with the lfe-repl plugin:

rebar3 lfe repl


However, this is the result:
===> Skipping lfe (from {git,"git://github.com/rvirding/lfe.git",
                                   
{ref,
                                       
"b84e9a8a1db6ffdd0cfe593fc8ad440ef72a5511"}}) as an app of the same name has already been fetched
===> Skipping lfe (from {git,"git://github.com/rvirding/lfe.git",
                                   
{ref,
                                       
"b84e9a8a1db6ffdd0cfe593fc8ad440ef72a5511"}}) as an app of the same name has already been fetched
===> Verifying dependencies...
===> The rebar3 lfe REPL is a development tool; to deploy applications in production,
     consider
using releases (http://www.rebar3.org/v3.0/docs/releases)
   
..-~.~_~---..
 
(      \\     )    |   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.0 (abort with ^G)
     `
-E___.-'


> ===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
> ===> When submitting a bug report, please include the output of `rebar3 report "your command"`
> %



and this is the crash dump contents:

Error: function_clause
[{'lr3-repl-cfg','update-env',
                 
[{test,[]}],
                 
[{file,"/Users/sashaafm/Documents/lfe_test/test/_build/default/plugins/lfe-repl/src/lr3-repl-cfg.lfe"},
                 
{line,13}]},
 
{lists,map,2,[{file,"lists.erl"},{line,1239}]},
 
{'lr3-repl-app','boot-check',1,
                 
[{file,"/Users/sashaafm/Documents/lfe_test/test/_build/default/plugins/lfe-repl/src/lr3-repl-app.lfe"},
                 
{line,6}]},
 
{'lfe-repl',do,1,
             
[{file,"/Users/sashaafm/Documents/lfe_test/test/_build/default/plugins/lfe-repl/src/lfe-repl.lfe"},
             
{line,41}]},
 
{rebar_core,do,2,
             
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_core.erl"},
             
{line,125}]},
 
{rebar_prv_do,do_tasks,2,
               
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_do.erl"},
               
{line,68}]},
 
{rebar_core,do,2,
             
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_core.erl"},
             
{line,125}]},
 
{rebar3,main,1,
         
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar3.erl"},
         
{line,56}]}]


This is on MacOS Sierra. Any idea on how to solve this? Isn't this supposed to be the standard way to load a LFE project into the REPL (similar to iex -S mix in Elixir)? I still haven't added any LFE code, I just wanted to play around with hackney through LFE.

This also caused a strange issue in my terminal where results from commands (like ls) were being displayed with lots of tabs and whitespace.

Other rebar3 LFE plugins like compile and test seem to run without problems.

Fred Hebert

unread,
Dec 22, 2016, 11:15:21 PM12/22/16
to lisp-flavo...@googlegroups.com
On 12/22, Sasha Fonseca wrote:
>
>This also caused a strange issue in my terminal where results from commands
>(like ls) were being displayed with lots of tabs and whitespace.
>

I can't easily comment on the REPL overall, but that issue is a known
one related to how escripts handle stdio and some weird stuff going on
with the drivers.

The accepted workaround is either:

- quit with q(), init:stop(), or ^G q

- use rebar3 local install to get a non-escript version of rebar3
unpackaged -- add it to your PATH and then it should avoid the
problem.

Regards,
Fred.

Sasha Fonseca

unread,
Dec 23, 2016, 5:44:57 AM12/23/16
to Lisp Flavoured Erlang
Fred, thank you for your reply. I'll try to emulate those steps. Although that weird terminal problem is not my main concern.

I've installed lfetool and it seems to do what lfe-repl rebar3 plugin is supposed to do. From what I understand lfetool is deprecated and should not be used anymore?
Reply all
Reply to author
Forward
0 new messages