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

rabbitmq_common compilation from source #1977

Open
aboroska opened this issue Dec 13, 2018 · 0 comments · May be fixed by #1978
Open

rabbitmq_common compilation from source #1977

aboroska opened this issue Dec 13, 2018 · 0 comments · May be fixed by #1978

Comments

@aboroska
Copy link
Contributor

When a project uses other tool for build and is not rebar3 discoverable prior to compilation (E.g.: rabbitmq_common), we could use pre hooks to compile it and also to generate the .app.src, .app files.

The following rebar.config still fails though:

{deps, [{rabbit_common, {git, "https://github.com/rabbitmq/rabbitmq-common.git", {ref, "9719670db30"}}}]}.

{overrides, [{override, rabbit_common, [{pre_hooks, [{compile, "make"}]}]}]}.

with error:

===> Dependency failure: source for rabbit_common does not contain a recognizable project and can not be built

The above error is from 3.7.5.

3.6.2 fails as well:

===> Dependency failure: Application rabbit_common not found at the top level of directory ...

Fetching the dependency calls rebar_app_discover:find_app/3 here:
https://github.com/erlang/rebar3/blob/3.7.5/src/rebar_fetch.erl#L33
which expects the .app.src or .app file to be present which in this case are generated by make.

If we could tell rebar3 not fail so quickly here:
https://github.com/erlang/rebar3/blob/3.7.5/src/rebar_fetch.erl#L36
maybe by replacing the throw https://github.com/erlang/rebar3/blob/3.7.5/src/rebar_fetch.erl#L37
with rebar_app_info:is_available(AppInfo1, true) we might have a solution.

             case rebar_app_discover:find_app(AppInfo1, AppDir, all) of
                 {true, AppInfo2} ->
                     rebar_app_info:is_available(AppInfo2, true);
                 false ->
-                    throw(?PRV_ERROR({dep_app_not_found, rebar_app_info:name(AppInfo1)}))
+                    rebar_app_info:is_available(AppInfo1, true)
             end;

This solves the problem but I am unsure about the consequences. Should be a rebar_app_discover:find_app/3 call between prehook of compile and compile to double check for the "app.src" later?

@aboroska aboroska linked a pull request Dec 13, 2018 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant