Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it assumed that you run mix deps.compile after updating config.exs?

I've started using Elixir + Phoenix Framework and started incorporating the addict library for user registration/authentication.

The docs for addict tell me to update the config.exs for the :addict app.

config :addict, not_logged_in_url: "/error",
                db: MyApp.MyRepo,
                user: MyApp.MyUser,
                    :

Replacing the db and user values did not take affect till I ran mix deps.compile for the addict code to pick up the configs.

Now my question is, is it assumed to run mix deps.compile when you make changes to config.exs?

The addict docs don't state this and for a newcomer like me, this isn't really obvious. I only realized this when I actually looked into addict's code and saw that it was being set at compile time via a module attribute (thus the necessity to run mix deps.compile).

like image 235
Daisuke Shimamoto Avatar asked Jun 28 '15 15:06

Daisuke Shimamoto


1 Answers

You need to recompile dependencies only if they have compile time configuration. Compile time configuration as such is not very common, so you should ping the addict folks and ask them to have better instructions to what happens when someone configures addict after it was compiled. Or convince them to avoid the compile time configuration in the first place if they can.

like image 90
José Valim Avatar answered Nov 16 '22 05:11

José Valim