-
Notifications
You must be signed in to change notification settings - Fork 521
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
rebar3 compile bare from mix fails 'unable to run 'pre hooks' #1804
Comments
@ericmj ^ Elixir guys are mentioning a lot of similar issues. |
I show how to reproduce with only rebar3 in the issue linked above: |
So I'm not too familiar with the bare compiler; my understanding is that it allows hex to handle all the dependencies, but will only run the compilation for its own stuff. This seems to be relying on a rebar_erl_vsn plugin, which is declared as a provider hook. When was the last version where this worked? So there's a few things I can think of that go wrong:
I'm thinking the third one is a likely candidate, but only if all of the Elixir folks with problems went from pre-3.5.0 versions to post-3.5.0 versions around the same time |
Elixir still uses rebar 3.3.6 by default, I will check if the issue exists in both versions. Elixir handles the deps for rebar projects but since plugins are handled separately we can not do anything with them. The bare compiler is supposed to fetch and compile them. |
Found the issue. For some reason Not sure of the fix yet... |
Would it make sense to force the namespace to |
That is what I did to fix it. No need to revert since state is not returned. Line 49 of rebar_hooks: case rebar_core:do(HookProviders, rebar_state:namespace(State1, default)) of I don't think this is a feature that is used... so it should be safe. Only something like alpaca or efene would be using it I believe, and I'm not seeing it used in their providers currently. |
I'd have forced the default profile at https://github.com/erlang/rebar3/blob/master/src/rebar_prv_bare_compile.erl#L49 and then the rest would have worked as usual -- maybe that's what you did. As for rebar_hooks, I guess the question is whether hooks should always use an explicit namespace when not using |
Oh true, I guess we could set the namespace (not profile) in bare compile since it is a special provider. |
Right, right now it either uses the explicit name space, like
to
Edit: I was wrong about namespace and |
Oh right, it is that namespaces act as
Is what works and |
Try Erlang/OTP 20.1 * older version of rebar3 without the problem with pre-hooks? See erlang/rebar3#1804
Example repo :
https://github.com/bryanhuntesl/poolboy_error
Docker image you can run to quickly reproduce the issue :
bryanhuntesl/reproduce-poolboy-mix-rebar3-compilation-bug
When mix calls to a rebar3 project in it's typical fashion -
rebar3 compile bare --paths ...
the rebar3 project fails to compile.When rebar3 is executed within the project directory, compilation succeeds.
Invoked via mix (failure):
Invoked within the dependency directory (success):
Invoked within the dependency directory with
--path
argument (failure)Environment
rebar3 report
to your message:rebar3 debug output and rebar3 report are attached
Looking into the debug output - it seems unable to run 'pre hooks' - I've seen this behavior in other projects too.
Unable to run pre hooks for 'compile', command 'erl_vsn' not found.
run.rebar3.debug.txt
rebar3.report.txt
The text was updated successfully, but these errors were encountered: