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

Can't get dependency on elixir on erlang module from private repository #311

Closed
jbdamiano opened this issue May 4, 2022 · 2 comments · Fixed by #312
Closed

Can't get dependency on elixir on erlang module from private repository #311

jbdamiano opened this issue May 4, 2022 · 2 comments · Fixed by #312

Comments

@jbdamiano
Copy link
Contributor

I have an erlang module A published on a private repository my_repo
This module A depends of module B from hexpm repository

When I perform mix deps.get
it retrieves my_repo/A and try tro retrieve B from my_repo instead of hexpm

The generated metadata.config

{<<"requirements">>,
 [{<<"B">>,
   [{<<"app">>,<<"B">>},
    {<<"optional">>,false},
    {<<"requirement">>,<<"~>1.0.3">>}]}]}.

As the field {<<"repository">>,<<"hexpm">>}, is missing mix try to retrieve B from my_repo instead of hexpm.

Is it possible to add this field ?

@jbdamiano
Copy link
Contributor Author

If in the file src/rebar3_hex_app.erl I change:
[{N, [{<<"app">>, A}, {<<"optional">>, false}, {<<"requirement">>, V}]} | Acc]; to [{N, [{<<"app">>, A}, {<<"optional">>, false}, {<<"repository">>,<<"hexpm">>}, {<<"requirement">>, V}]} | Acc];

the mix deps.get is working correctly.

@starbelly
Copy link
Member

This came up recently in regards to better support for organization on hex.pm. I think what you have is what I was thinking about as a simple solution for private package A depending on private package B and so on and so forth.

I haven't had time to do a PR for this and what's more give it a a lot of testing. Would you like to open a PR?

I'm not sure if this will work when both deps are fetched via rebar, but if it solves at least one problem that at least a step in the right direction.

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.

2 participants