Closed
Description
Elixir and Erlang/OTP versions
Erlang/OTP 25 [erts-13.2.2.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
Elixir 1.16.0 (compiled with Erlang/OTP 25)
Operating system
macOS
Current behavior
When loadconfig
is called repeatedly it merges application configs instead of overwriting.
Repro:
- create an empty mix app
- add
config/config.exs
- add to config
config :logger, foo: 1
- in iex run
Mix.start()
Code.compile_file("mix.exs")
Mix.Task.run("loadconfig")
[
logger: [foo: 1]
]
Application.get_env(:logger, :foo)
1
- rename
:foo
to:bar
Mix.Task.run("loadconfig")
[
logger: [bar: 1]
]
Application.get_env(:logger, :bar)
1
- Verify that old key is still in app env
Application.get_env(:logger, :foo)
1
Originally reported in https://elixirforum.com/t/how-can-i-prevent-the-lsp-from-invoking-my-custom-mix-compiler/59802/6 and followed up in elixir-lsp/elixir-ls#1030
Expected behavior
I'm not sure this is a bug but there is no mention of this behavior in https://hexdocs.pm/mix/1.16.0/Mix.Tasks.Loadconfig.html. This comment states thet the configs are not deep merged
Metadata
Metadata
Assignees
Labels
No labels