elixir
elixir copied to clipboard
Override and In Umbrella Configuration Improvement
Elixir and Erlang/OTP versions
Elixir 1.14.0 (compiled with Erlang/OTP 24)
Operating system
MacOS
Current behavior
- Clone any repo into an umbrella project
gh repo clone yordis/eventstore - Swap the dependency to be the local version in your app
{:eventstore, in_umbrella: true, override: true}, - Notice the issue regardless the
override: true
Dependencies have diverged:
* eventstore (apps/eventstore)
the dependency eventstore in mix.exs is overriding a child dependency:
> In mix.exs:
{:eventstore, [path: "apps/eventstore", from_umbrella: true, env: :dev]}
> In deps/commanded_eventstore_adapter/mix.exs:
{:eventstore, "~> 1.3", [env: :prod, hex: "eventstore", repo: "hexpm", optional: false]}
Please remove the conflicting options from your definition
** (Mix) Can't continue due to errors on dependencies
Expected behavior
@ericmj asked me to create the ticket
"I think override: true doesn’t work umbrella apps, but I am not sure; I need to investigate more. Can you open an issue so we can look into this? It may be that we just need to add a warning if override and in_umbrella are used together."
Thank you for the report!
This is by design. An umbrella child can run in isolation from the umbrella root. If they have conflicting dependencies, then it means that, when run from root, you will use one dependency, when run from the child, another one, which will lead to surprising behaviours. You need to keep them consistent at all times. :)
@ericmj asked me to open it to try to warn about that usage. That is why I opened the issue.
Oh, I got it. We want to warn that override can be discarded.