Mixed Elixir/Erlang Umbrella Application Configuration

Hi All – I’m wondering what I’m doing wrong here. I’ve created an umbrella project like so:

mix new --umbrella umb_proj
cd umb_proj/apps
mix new ex_proj
rebar3 new app erl_proj

and updated umb_proj/mix.exs to read

def project do
    [
      apps_path: "apps",
      apps: [:ex_app, :erl_app],
      version: "0.1.0",
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

but still receive this message when I attempt mix deps.get (or any other mix command):

warning: path "apps/erl_app" is a directory but it has no mix.exs. Mix won't consider this directory as part of your umbrella application. Please add a "mix.exs" or set the ":apps" key in your umbrella configuration with all relevant apps names as atoms

It sure seems like I’ve done what was asked. Is there something I’m missing?

Thanks! b.

This all in a Docker elixir:1.15 container:

Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:5:5] [ds:5:5:10] [async-threads:1] [jit]
Elixir 1.15.4 (compiled with Erlang/OTP 26)
Mix 1.15.4 (compiled with Erlang/OTP 26)
rebar 3.20.0 on Erlang/OTP 26 Erts 14.0.2

Edited to add:

Creating another otherwise unused Elixir flavored application with the dependency

{:erl_proj, in_umbrella: true, manager: :rebar3}

prompts compilation of the erl_proj. I still get the warning – that seems like an error – and recompile doesn’t seem to bother with the Erlang application (although r :erl_app.module seems to behave correctly).

I don’t know if you can do it, i.e. to have rebar3 project as an umbrella Mix project child. My guess is not.

I think you can do two things instead:

  1. Use mix to compile your Erlang project, not rebar
  2. Place the erl_app in a separate directory (like vendor/erl_app) and then don’t use in_umbrella: true but path: ... and manager: rebar3 in your mix.exs file in one of the umbrella apps to depend on it.
1 Like

Thanks for the response and the idea. I hadn’t thought about moving in this direction and it turned out to be a nice simplification of the project. I now have Nitrogen well integrated into an otherwise Elixir project and that was my goal. Building and deploying releases with the /vendor approach works as expected. Yay.

For the next person though: the umbrella project did in fact work eventually although I wasn’t able to figure out how to suppress the warning (admittedly I only cast a cursory eye over the Elixir source responsible). I’ll chalk this up to user error.

1 Like