Adding local elixir dependencies to erlang project

Hey. Long story short trying to add elixir to erlang project. Tried replace rebar3 with mix but with no luck. Now I’m trying add local elixir dependency to project. It kindly works. Problem is that every second run elixir part is not included.

Steps to reproduce:

$ rebar3 new app local_mix
$ cd local_mix
$ mix new ex_app

rebar.config:


{deps, [
    {ex_app, {path, "./ex_app"}}
  ]
}.

{shell, [
  % {config, "config/sys.config"},
    {apps, [local_mix]}
]}.

{plugins, [
    rebar3_path_deps,
    rebar_mix
]}.
  • rebar3 shell
  • 'Elixir.ExApp':hello(). - works
  • crtl-c
  • rebar3 shell
  • 'Elixir.ExApp':hello(). - undefined function

if you run rebar3 shell once again it will work :slight_smile:

Tried to mess with both of the rebar plugins, but can’t figure it out what is happening during building.

Thanks for help!

Have you verified this is not an issue when using the path_deps plugin with rebar_mix? As in, doing it only with hex elixir dependencies.

1 Like

Looks like it is. Both plugins alone works fine. Tried to figure out what exactly is happening but with no luck.

Figured out something:

===> Verifying dependencies...
===> Upgrading ex_app (from {path,"./ex_app",{mtime,<<"2023-09-27T13:09:08Z">>}})
===> Compiling ex_app
Generated ex_app app
===> Analyzing applications...
===> Compiling local_mix
===> Booted local_mix

Now it’s working.

===> Verifying dependencies...
===> Upgrading ex_app (from {path,"./ex_app",{mtime,<<"2023-09-27T13:09:08Z">>}})
===> Analyzing applications...
===> Compiling local_mix

===> Booted local_mix

Now it’s not.
Just thinking but looks like ===> Upgrading ex_app line might remove app. And updating means “copying once again… but there is no compiled files anymore”

Didn’t found anything it those plugins that removes old app
Why It leaves app uncompiled (without ebin)

Any thoughts? Thanks!