Help needed with umbrella-settings

I am working on an application that has multiple parts. Therefore, it was split in an Umbrella application. However, I am having trouble figuring out what should be put in which mix.exs file. Starting the project normally works fine, but when attempting to compile the application for production-use, (using edeliver), I get strange errors.

One application (payment_dispatcher) is a client that consumes an external API.
One application (heads) is a Phoenix server.
heads needs payment_dispatcher as dependency, as the server needs access to parts of the API.

Basically:

appname
--heads
----phoenix
----payment_dispatcher
----(... some other things)
--payment_dispatcher
----httpoison
----(... some other things)

When edeliver uses the following command to compile the files:

APP="appname" MIX_ENV="prod" AUTO_VERSION="" SKIP_RELUP_MODIFICATIONS="" RELUP_MODIFICATION_MODULE="" mix do clean, deps.compile, compile

I get an error that HTTPoison.Base, one of the modules inside the :httpoison dependency of payment_dispatcher cannot be found.

I have listed :httpoison inside apps/payment_dispatcher/mix.exs's deps and applications lists. But the error keeps happening.

I am unsure as to:

  • Why above error happens. Is compilation in the wrong order? How can I change that?
  • Where to put payment_dispatcher as dependency: In mix.exs or apps/heads/mix.exs? (as the Phoenix app depends on it)

Any help would be appreciated.

2 Likes

I have the same or at least problem with deps and edeliver. Umbrella app which at the moment has just one simple app with :amqp dependency.
Works fine locally, but when I do “mix edeliver build release” I get :AMQP not found when it is trying to compile my code. When I go to the build host and build the app myself it works. I can see from edeliver debug log that nothing went wrong in getting the depencies yet the error persist.

In any case, if you have found a solution for this let me know.

Any help would be much appreciated.

Do you guys have one app specifying another one as dependency with in_umbrella? I think if you have apps
apps/a and apps/b, you pick up one, say a and edit it’s apps/a/mix.exs and add something like this to deps:

{:b, in_umbrella: true}

please let me know if that helps or not :slight_smile:

1 Like

The missing dependency was cause by cleanup not working. If I ran mix edeliver build release --skip-mix-clean. I would get past that problem but then I ran into loads of other problems.
The whole thing is described in more detail in this SO question.

1 Like