Mix umbrella apps not started

I have issue like #2753, but for now it have more sense.
Following docs

:applications - all applications your application depends on at runtime. By default, this list is automatically inferred from your dependencies. Any extra Erlang/Elixir dependency must be specified in :extra_applications. Mix and other tools use the application list in order to start your dependencies before starting the application itself.

And really, when I add dependence to regular project, it is started, but when I add dependence to umbrella app, it isn’t started. Also I can’t define extra_applications for umbrella project.

Can you explain me is it bug and should I create issue in elixir repo? Or how I can fix it (except creating app in apps directory with only one this dependence)?

My elixir version is 1.6.3, OS X 10.13.3

The top level mix.exs does not define an application, none of its dependencies will be started. Each application inside apps/ is an actual application and that’s where dependencies you want to depend on should go. The to level mix.exs is really just for convenience development dependencies as far as I can tell.

I wonder if the generator should include comments to that effect.

Thank you for your reply

I have this comments before deps:

  # Dependencies listed here are available only for this
  # project and cannot be accessed from applications inside
  # the apps folder.

Hmm, now I don’t understand sense of umbrella project dependencies 'cos umbrella has no code, also this dependencies cannot be accessed from applications inside the apps folder and also it isn’t started with umbrella project.

Ok, umbrella start every app in apps folder (can we call they dependencies of umbrella project? may be yes, may be no, but they starts). Can it also start other app, not listed in apps folder, but declared in other way?

1 Like

can we call they dependencies of umbrella project?
They are not dependencies. The main thing to realize is that there is no “umbrella application”. It’s all one project in the sense that it’s all inside a single folder and you can run commands that run everything, but there is no central umbrella application, just a set of applications inside the apps folder.

Consequently:

Can it also start other app, not listed in apps folder, but declared in other way?
No. Each actual application inside apps should list whatever dependencies it needs, and then those will be started.

If I correctly understood you, using umbrella we have one project with multiple applications in apps folder. Also project can’t have dependencies (but why there is deps function in umbrella’s mix.exs… nevermind).

So now my question is: may elixir developers consider adding ability to declare other applications, that will be included to that project (using deps or in other way)?

Can you talk about what it is you’re trying to accomplish? I think a concrete example may make this easier.

There is a project called remix that allows to recompile elixir code on-the-fly that useful for development. But it isn’t working with umbrella’s and I tried to fix it in my fork.

When somebody adds remix to one application inside umbrella project, it starts working for all applications in project (so I added support of remix option inside project config).

So if remix anyway start for all apps just after adding to one app deps, then we can add it to umbrella project deps - I thought. But that isn’t working.

So the only working solution I think is create additional application in apps folder with no code etc but with only one dependence just to start it together with other apps on project start. But there must be way to make that cleaner.