Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Error when running twice as provider hook from alias #329

Open
Alberdi opened this issue Dec 30, 2021 · 0 comments
Open

Internal Error when running twice as provider hook from alias #329

Alberdi opened this issue Dec 30, 2021 · 0 comments

Comments

@Alberdi
Copy link

Alberdi commented Dec 30, 2021

I've got a project where I want to automatically format the code when compiling, so I've added erlfmt as a provider hook. I didn't have any issues with this flow until I added an alias that runs ct and cover. In that case I always get an "Internal Error".

I can provide a minimal example that displays the bug:

ᐅ rebar3 -v 
rebar 3.17.0 on Erlang/OTP 23 Erts 11.2.2.2

ᐅ rebar3 new lib erlfmt_bug
===> Writing erlfmt_bug/src/erlfmt_bug.erl
===> Writing erlfmt_bug/src/erlfmt_bug.app.src
===> Writing erlfmt_bug/rebar.config
===> Writing erlfmt_bug/.gitignore
===> Writing erlfmt_bug/LICENSE
===> Writing erlfmt_bug/README.md

ᐅ cd erlfmt_bug

ᐅ echo '
{project_plugins, [erlfmt]}.

{erlfmt, [write]}.

{provider_hooks, [
    {pre, [{compile, fmt}]}
]}.

{alias, [
    {test, [
        {ct, "--cover"},
        {cover, "-m 100"}
    ]}
]}.
' >> rebar.config

ᐅ rebar3 test
[...]
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling erlfmt_bug
===> Running Common Test suites...
All 0 tests passed.
===> Verifying dependencies...
rebar3 fmt Internal Error
exit:normal
[{erlfmt_cli,parallel_loop,5,
             [{file,"/Users/marcelino/Developer/erlfmt_bug/_build/default/plugins/erlfmt/src/erlfmt_cli.erl"},
              {line,484}]},
 {erlfmt_cli,unprotected_with_config,2,
             [{file,"/Users/marcelino/Developer/erlfmt_bug/_build/default/plugins/erlfmt/src/erlfmt_cli.erl"},
              {line,128}]},
 {erlfmt_cli,with_parsed,2,
             [{file,"/Users/marcelino/Developer/erlfmt_bug/_build/default/plugins/erlfmt/src/erlfmt_cli.erl"},
              {line,104}]},
 {rebar3_fmt_prv,do,1,
                 [{file,"/Users/marcelino/Developer/erlfmt_bug/_build/default/plugins/erlfmt/src/rebar3_fmt_prv.erl"},
                  {line,43}]},
 {rebar_core,do,2,
             [{file,"/home/runner/work/rebar3/rebar3/src/rebar_core.erl"},
              {line,155}]},
 {rebar_hooks,run_provider_hooks_,6,
              [{file,"/home/runner/work/rebar3/rebar3/src/rebar_hooks.erl"},
               {line,70}]},
 {rebar_hooks,run_all_hooks,6,
              [{file,"/home/runner/work/rebar3/rebar3/src/rebar_hooks.erl"},
               {line,18}]},
 {rebar_prv_compile,'-compile/4-lc$^0/1-0-',3,
                    [{file,"/home/runner/work/rebar3/rebar3/src/rebar_prv_compile.erl"},
                     {line,151}]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant