-
Notifications
You must be signed in to change notification settings - Fork 34
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
When hex_erl is included as project dependency it tries to run protobuf provider hooks #20
Comments
Yeah, project plugins are specifically meant for plugins that override a default command's behavior, and as such are only allowed for top-level apps (i.e. making your own |
@wojtekmach Should hex_erl have a project-only dependency from gpb? Currently I can't inckude hex_erl as dependency of my project without explicitely depending on gpb. |
If I understand correctly rebar3_gpb_plugin should be moved to |
Alternatively we can remove protobuf from |
|
No, As for gpb, unless the generated modules are committed then yes it needs to be a regular plugin. |
@tsloughter on See: https://github.com/hexpm/hex_erl/pull/23/files - it's safe to remove provider hooks because we commit generated .erl from .pb. On that branch I switch project_plugins to plugins, btw, which I guess I'll revert, but in either case stuff is being downloaded. Help would be very appreciated. edit: clarified fetching vs using |
It is a bug in rebar3 if a project plugin is fetched when the application is used as a dependency of another project. |
what's weird is when I add hex_erl on a rebar3 project and do For now, I've removed provider hooks and so part of the issue is solved. |
Mix downloads deps its own way, and only gives paths for rebar3 to compile. |
@ferd Mix downloads deps but this is a plugin so it would be rebar3 downloading it when running the bare compiler. |
My guess is that rebar3 bare compiler runs |
ah that could be a possible interpretation. We have no way to know if the bare compiler is used for a dep or a top-level app (another tool than mix could wrap it), and maybe a switch should be needed for that. |
Yea, that'd be the issue. Not sure if it is easily changed. |
Until we fix this in mix and/or rebar3, I've pushed a change that puts gpb stuff into dev profile and protobuf stuff into test profile so that mix will no longer download plugins unnecessarily by default. See: 1e5c558 |
I have a project that includes hex_erl in rebar.config e.g.
When I run
rebar3 compile
in my project I get the following error:It seems that when protobuf is added as project plugin it isn't fetched as project dependency. https://github.com/hexpm/hex_erl/blob/6c8973c2ce3acea1ebec8f08d23b4951f272361b/rebar.config#L3-L6
https://github.com/hexpm/hex_erl/blob/6c8973c2ce3acea1ebec8f08d23b4951f272361b/rebar.config#L18-L23
Please refer to end of this section in rebar3 documentation: http://www.rebar3.org/v3/docs/using-available-plugins#section-project-plugins-and-overriding-commands
The text was updated successfully, but these errors were encountered: