rebar3 icon indicating copy to clipboard operation
rebar3 copied to clipboard

Uncaught error in rebar_core / leex on rebar3 shell

Open RobWagMLP opened this issue 1 year ago • 7 comments

Environment

Rebar3 report
 version 3.19.0
 generated at 2022-09-07T18:48:02+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: 
Entered as:
  
-----------------
Operating System: x86_64-pc-linux-gnu
ERTS: Erlang/OTP 25 [erts-13.0.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]
Root Directory: /usr/lib/erlang
Library directory: /usr/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.12.2
certifi: 2.9.0
cf: 0.3.1
compiler: 8.2
crypto: 5.1.1
cth_readable: 1.5.1
erlware_commons: 1.5.0
eunit: 2.7.1
eunit_formatters: 0.5.0
getopt: 1.0.1
inets: 8.0
kernel: 8.4.2
providers: 1.9.0
public_key: 1.13
relx: 4.7.0
sasl: 4.2
ssl_verify_fun: 1.1.6
stdlib: 4.0.1
syntax_tools: 3.0
tools: 3.5.3

-----------------
Escript path: /usr/local/bin/rebar3
Providers:
  app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit get-deps help install install_deps lint list lock new path pkgs release relup report repos shell state tar tree unlock update upgrade upgrade upgrade vendor version xref 

Current behaviour

Hey Hey,

we recently upgraded to erlang otp 25, Since then i get this error when trying to start the application.

===> Uncaught error in rebar_core. Run with DIAGNOSTIC=1 to see stacktrace or consult rebar3.crashdump

Crashdump files shows the following:

Error: undef
[{leex,file,
       ["/home/vagrant/nbaserl/_build/default/lib/eini/src/eini_lexer.xrl",
        [{return,true}]],
       []},
 {rebar_compiler_xrl,compile,4,
                     [{file,"/home/runner/work/rebar3/rebar3/src/rebar_compiler_xrl.erl"},
                      {line,38}]},
 {rebar_compiler,do_compile,5,
                 [{file,"/home/runner/work/rebar3/rebar3/src/rebar_compiler.erl"},
                  {line,273}]},
 {rebar_compiler,compile_each,5,
                 [{file,"/home/runner/work/rebar3/rebar3/src/rebar_compiler.erl"},
                  {line,265}]},
 {rebar_compiler,run,4,
                 [{file,"/home/runner/work/rebar3/rebar3/src/rebar_compiler.erl"},
                  {line,256}]},
 {lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},
 {rebar_prv_compile,'-build_rebar3_apps/3-lc$^0/1-0-',3,
                    [{file,"/home/runner/work/rebar3/rebar3/src/rebar_prv_compile.erl"},
                     {line,374}]},
 {rebar_prv_compile,build_rebar3_apps,3,
                    [{file,"/home/runner/work/rebar3/rebar3/src/rebar_prv_compile.erl"},
                     {line,389}]}]


This issue seems to occur on all ubuntu-machines we are running. On Mac it seems fine. A recommendation for some possible fixes would be really appreciated :)

I'm completely lost since i have absolutely no idea what is causing this and i cant find a similar issue reported by someone else . Thanks in advance

RobWagMLP avatar Sep 07 '22 18:09 RobWagMLP

Have you made sure all the packages are installed in your linux install? Linux distributions will often ship only a subset of the standard distribution in an attempt to save space and will cause all sorts of issues.

ferd avatar Sep 07 '22 19:09 ferd

Hey and thanks for your reply. Yes actually i am sure. The application was running properly before the upgrade on otp-22 and opt-24. If anything has been added that requires some additional packages i would be happy to know what it is :).

RobWagMLP avatar Sep 07 '22 19:09 RobWagMLP

If you just open a random erl shell (not rebar3 related) and call leex:module_info(). does it work?

ferd avatar Sep 07 '22 20:09 ferd

nope, getting an undefined function exception.

RobWagMLP avatar Sep 07 '22 20:09 RobWagMLP

then the problem is with your install, not rebar3. How did you install your Erlang?

ferd avatar Sep 07 '22 20:09 ferd

This is happening in a Vagrant VM running Ubuntu 20.04.5 LTS, and Erlang is installed using APT. (with the erlang-solutions repository) We have the following packages installed:

erlang-asn1
erlang-base
erlang-crypto
erlang-dev
erlang-eunit
erlang-inets
erlang-mnesia
erlang-public-key
erlang-runtime-tools
erlang-solutions
erlang-ssh
erlang-ssl
erlang-syntax-tools
erlang-tools
erlang-xmerl

We download the official version of rebar3 when setting up the VM.

whitelynx avatar Sep 08 '22 07:09 whitelynx

leex is part of the 'parsetools' app so you may need to add erlang-parsetools.

ferd avatar Sep 08 '22 14:09 ferd