"Compiling vendor/eunit_formatters/src/eunit_progress.erl failed" while rebar3 installation

I was trying to install rebar3 on Windows with WSL. After executing ./bootstrap, I got the error below. What seems to be the problem?

./bootstrap
Evaluating config script "/mypath/rebar3/_build/default/lib/rebar/src/rebar.app.src.script"
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling cf
===> Compiling cth_readable
===> Compiling eunit_formatters
===> Compiling vendor/eunit_formatters/src/eunit_progress.erl failed
vendor/eunit_formatters/src/eunit_progress.erl:none: undefined parse transform 'eunit_striptests'

escript: exception throw: rebar_abort
  in function  rebar_utils:abort/0 (apps/rebar/src/rebar_utils.erl, line 718)
  in call from rebar_parallel:parallel_dispatch/4 (apps/rebar/src/rebar_parallel.erl, line 39)
  in call from rebar_parallel:parallel_dispatch/4 (apps/rebar/src/rebar_parallel.erl, line 43)
  in call from rebar_compiler:run/4 (apps/rebar/src/rebar_compiler.erl, line 253)
  in call from lists:foreach/2 (lists.erl, line 1342)
  in call from rebar_prv_compile:'-build_rebar3_apps/3-lc$^0/1-0-'/3 (apps/rebar/src/rebar_prv_compile.erl, line 374)
  in call from rebar_prv_compile:build_rebar3_apps/3 (apps/rebar/src/rebar_prv_compile.erl, line 389)
  in call from rebar_prv_compile:run_compilers/4 (apps/rebar/src/rebar_prv_compile.erl, line 192)
3 Likes

What version of OTP are you using and what version of rebar3? This information would be helpful in diagnosing the issue.

1 Like

Hi, otp’s version is:

$ erl
Erlang/OTP 24 [erts-12.3.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]

Eshell V12.3.2.1 (abort with ^G)
1>

for rebar3, I used this:

sudo apt-get install rebar3

How can I check rebar3’s version?

1 Like

Like so:

$ rebar3 version
rebar 3.17.0 on Erlang/OTP 25 Erts 13.0.4
1 Like
$ sudo wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3

Above command returned this:

https://s3.amazonaws.com/rebar3/rebar3
Resolving s3.amazonaws.com (s3.amazonaws.com)... 52.216.86.5
Connecting to s3.amazonaws.com (s3.amazonaws.com)|52.216.86.5|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 959664 (937K) [binary/octet-stream]
Saving to: ‘rebar3’

rebar3                        100%[=================================================>] 937.17K   500KB/s    in 1.9s

‘rebar3’ saved [959664/959664]

chmod: changing permissions of 'rebar3': Operation not permitted

also:

$ ./rebar3 local install
-bash: ./rebar3: Permission denied

So I cannot run this code:

rebar3 version
1 Like

You’ve used sudo to download rebar3 using wget, so it is now owned by root. Try deleting it with sudo rm rebar3 and then running again that command you posted but without sudo.

Best to avoid using sudo unless you really have to as it can result in problems like these, and also there is a security risk to using it.

3 Likes

Thanks, that’s partially solved my problem.

cd ~

then

$ wget https://s3.amazonaws.com/rebar3/rebar3

then

sudo chmod +x rebar3

then

$ ./rebar3 local install

now I have this outcome:

===> Fetching enotify v0.1.0
===> Fetching nova v0.9.2
===> Fetching rebar3_ex_doc v0.2.13
===> Analyzing applications...
===> Compiling rebar3_ex_doc
===> Fetching rebar3_erlydtl_plugin (from {git,"https://github.com/tsloughter/rebar3_erlydtl_plugin.git",
                                 {branch,"master"}})
===> Fetching erlydtl (from {git,"https://github.com/erlydtl/erlydtl.git",{branch,"master"}})
===> Analyzing applications...
===> Compiling erlydtl
===> Compiling .cache/rebar3/plugins/erlydtl/src/filter_lib/erlydtl_slice.erl failed
.cache/rebar3/plugins/erlydtl/src/filter_lib/erlydtl_slice.erl:none: undefined parse transform 'eunit_autoexport'

===> Errors loading plugin {rebar3_erlydtl_plugin,".*",
                                   {git,
                                    "https://github.com/tsloughter/rebar3_erlydtl_plugin.git",
                                    {branch,"master"}}}. Run rebar3 with DEBUG=1 set to see errors.
===> Fetching cowboy v2.9.0
===> Fetching erldb v1.0.0
===> Fetching jhn_stdlib v3.6.2
===> Fetching pmod_transform v1.1.0
===> Fetching routing_tree v1.0.1
===> Fetching thoas v0.2.0
===> Fetching uuid v2.0.4
===> Fetching cowlib v2.11.0
===> Fetching dh_date v1.0.0
===> Fetching rebar3_hex v7.0.2
===> Fetching hex_core v0.8.4
===> Fetching verl v1.1.1
===> Analyzing applications...
===> Compiling verl
===> Compiling .cache/rebar3/plugins/erlydtl/src/erlydtl_filters.erl failed
.cache/rebar3/plugins/erlydtl/src/erlydtl_filters.erl:none: undefined parse transform 'eunit_autoexport'

===> Errors loading plugin rebar3_hex. Run rebar3 with DEBUG=1 set to see errors.
===> Fetching mysql v1.6.0
===> Fetching poolboy v1.5.2
===> Fetching quickrand v2.0.4
===> Fetching ranch v1.8.0
===> Errors loading plugin {rebar3_nova,
                                   {git,
                                    "https://github.com/novaframework/rebar3_nova.git",
                                    {branch,"master"}}}. Run rebar3 with DEBUG=1 set to see errors.
===> Extracting rebar3 libs to /home/gordon/.cache/rebar3/vsns/3.19.0/lib...
===> Writing rebar3 run script /home/gordon/.cache/rebar3/bin/rebar3...
===> Add to $PATH for use: export PATH=/home/gordon/.cache/rebar3/bin:$PATH

But rebar3 is still not added to PATH:

$ rebar3 version
-bash: rebar3: command not found

In order to see version I did this:

$ ./rebar3 -v
===> Analyzing applications...
===> Compiling erlydtl
===> Compiling .cache/rebar3/plugins/erlydtl/src/filter_lib/erlydtl_slice.erl failed
.cache/rebar3/plugins/erlydtl/src/filter_lib/erlydtl_slice.erl:none: undefined parse transform 'eunit_autoexport'

===> Errors loading plugin {rebar3_erlydtl_plugin,".*",
                                   {git,
                                    "https://github.com/tsloughter/rebar3_erlydtl_plugin.git",
                                    {branch,"master"}}}. Run rebar3 with DEBUG=1 set to see errors.
===> Analyzing applications...
===> Compiling verl
===> Compiling .cache/rebar3/plugins/erlydtl/src/erlydtl_filters.erl failed
.cache/rebar3/plugins/erlydtl/src/erlydtl_filters.erl:none: undefined parse transform 'eunit_autoexport'

===> Errors loading plugin rebar3_hex. Run rebar3 with DEBUG=1 set to see errors.
===> Errors loading plugin {rebar3_nova,
                                   {git,
                                    "https://github.com/novaframework/rebar3_nova.git",
                                    {branch,"master"}}}. Run rebar3 with DEBUG=1 set to see errors.
rebar 3.19.0 on Erlang/OTP 24 Erts 12.3.2.1

It looks like your Erlang installation is missing the eunit part and possibly others too. If you have installed it using your OS’s package manager you may need to install more packages to get the full installation.

1 Like

Thanks, I also installed Erlang to Windows. Instead of using the uncomplete Erlang in WSL, how can I force rebar3 installation to use the Erlang installed on my C drive?

1 Like

You will need to use the Windows command line rather than the WSL one in order to use Erlang directly on Windows.

1 Like

I’m having problems with rebar3 too.

% erl
Erlang/OTP 24 [erts-12.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]

Eshell V12.2.1 (abort with ^G)
% wget [https://s3.amazonaws.com/rebar3/rebar3](https://s3.amazonaws.com/rebar3/rebar3)
% chmod a=rx rebar3
% mv rebar3 ~/local/bin
% rebar3 version
===> Rebar dependency asn1 could not be loaded for reason {"no such file or directory",
"[asn1.app](http://asn1.app)"}

I was getting this kind of problem before, which is why I reinstalled rebar3.
(Yes I have tried getting the latest and greatest Erlang release, and no it didn’t work.)

This looks like another incomplete Erlang/OTP installation. How did you install it?

2 Likes