Rebar3 fails to compile: Task failed: {{badmatch,[]}

Hi,
rebar3 fails to compile/escriptize/dialyzer my small hobby project. This is on Manjaro Linux, using rebar3 from the git, in Erlang/OTP 27. Here are the first lines of the error messages:

[hph@hackbrett4 enet]$ REBAR_COLOR=none ~/bin/rebar3 shell
Verifying dependencies...
Analyzing applications...
Compiling enet
Task failed: {{badmatch,[]},
                  [{rebar_compiler_format,colorize,2,
                       [{file,
                            "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_compiler_format.erl"},
                        {line,74}]},
                   {rebar_compiler_format,format,5,
                       [{file,
                            "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_compiler_format.erl"},
                        {line,25}]},
                   {rebar_base_compiler,'-format_errors/4-lc$^1/1-1-',4,
                       [{file,
                            "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_base_compiler.erl"},
                        {line,278}]},
                   {rebar_base_compiler,'-format_errors/4-lc$^0/1-0-',3,
                       [{file,
                            "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_base_compiler.erl"},
                        {line,278}]},
                   {rebar_base_compiler,'-format_errors/4-lc$^0/1-0-',3,
                       [{file,
                            "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_base_compiler.erl"},
                        {line,279}]},
                   {rebar_base_compiler,error_tuple,5,
                       [{file,
                            "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_base_compiler.erl"},
                        {line,160}]},
                   {rebar_compiler,compile_worker,2,
                       [{file,
                            "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_compiler.erl"},
                        {line,337}]},
                   {rebar_parallel,worker,3,
                       [{file,
                            "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_parallel.erl"},
                        {line,260}]}]}
=ERROR REPORT==== 5-Oct-2024::20:06:53.273340 ===
Error in process <0.196.0> with exit value:
{{badmatch,[]},
 [{rebar_compiler_format,colorize,2,
                         [{file,"/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_compiler_format.erl"},
                          {line,74}]},
...

rebar.config is:

{erl_opts, [no_debug_info]}.

{escript_incl_apps, []}.
{escript_main_app, enet}.
{escript_name, enet}.

I’m a bit lost, not experienced enough to find the reason. Any hints welcome.
HP

1 Like

I can not replicate this. Could you open an issue on rebar3 repo?

Additionally, it would be helpful to emit debug info for the issue i.e., REBAR_COLOR=none DEBUG=true ~/bin/rebar3 shell

Thanks for the reply. I just found out the reason. I had some json and yaml and some .beam files in the src dir, after removing them rebar3 compiles fine. So my stupidity.

1 Like