-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loadconfig not clearing application env #13246
Comments
I will improve the docs but the behavior you see is correct. The deep merging is only within an application. We don’t erase previously defined application keys, regardless of how they were set. |
In your case, you may need to delete all application keys from the environment with But this brings up back to previous conversations, where I think it is better to separate the LS runtime from the application runtime. Then to restart the application, you boot a new runtime. It is the best way to guarantee there is no state carried across. Because if you revert the application environment, you revert the supervision trees, people can always change the application environment directly, start named processes outside of supervision trees, etc. |
Workaround elixir-lang/elixir#13246 Fixes #1030
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:
config/config.exs
:foo
to:bar
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
elixir/lib/mix/lib/mix/tasks/loadconfig.ex
Line 52 in 38ddc98
The text was updated successfully, but these errors were encountered: