isaacsanders

isaacsanders

Why doesn't `mix run` just call `mix deps.get`?

When I try to run my applications and I haven’t updated the dependencies, the output tells me to run mix deps.get.

Why doesn’t the binary just do that instead of ask me for it?

This is a discussion of the Pros/Cons of both automatically running mix deps.get and requiring the developer to manually run the Mix task.

Most Liked

NobbZ

NobbZ

I prefer to have full controll over what happens when.

Sometimes I am simply offline, and when I do eg. a cargo build or rebar3 build they error out with a huge complain about beeing unable to load their deps. This is annoying. I knew in advance that I’m offline, you don’t need to tell me. If though you had told me that dependencies are missing and I need to call something else to download them, I had the option the choose between using a mobile connection to download them or to do something else.

Also both tools I mentioned, do not have an actual task to trigger just the download of deps, without anything else. This is also problematic when building containers with some things cached, and requires some nasty hoops to jump through.

LostKobrakai

LostKobrakai

Running mix deps.get does have the sideeffect of adding new versions to mix.lock for dependencies not present before. Personally I like that this does not happen for commands, which might not be expected to cause sideeffects.

LukeWood

LukeWood

I’d personally be ok with mix run calling mix deps.get if the deps weren’t present and it notified the user first

Where Next?

Popular in Discussions Top

jswny
I would like to better understand what the advantages/disadvantages of umbrella applications are compared to structuring your app as as s...
New
andre1sk
A big advantage to Elixir is all the distributed goodness but for many applications running on multiple nodes having integrated Etcd, Zoo...
New
mikl
I wanted to capitalize a string, and tried using String.capitalize(). That generally works well, until you try to capitalize a word like...
New
sashaafm
I’m trying to evaluate the best combo/stack for a BEAM Web app. Right now I’m exploring Yaws a bit, after having dealt with Phoenix for a...
New
owaisqayum
I have a sample string sentence = "Hello, world ... 123 *** ^%&*())^% %%:>" From this string, I want to only keep the integers, ...
New
praveenperera
How We Replaced React with Phoenix By: Thought Bot
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 19568 166
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
restack_oslo
Hello, Please pardon me for any faux paux. I am 46 and this is my first time on a forum of any kind. I wanted to to get answers from tho...
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39297 209
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement