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

kaikuchn

kaikuchn

In at least 99% of cases I run mix deps.get after a command crashes due to outdated deps. For me personally and the way that I work, it is just bothersome to have to run it manually.

However, I believe that there are valid reasons not to do it automatically. So maybe instead of failing due to outdated deps, it could ask whether or not to get the deps? And maybe this could be configurable (always yes, always no)?

Where Next?

Popular in Discussions Top

AstonJ
Inspired by @dogweather’s thread about Active Record Doctor, have you seen any impressive or cool things in other non-BEAM languages or f...
New
lud
Hello, I just extracted the boilerplate management code that I used to work with in previous years: It is yet another generic input d...
New
thiagomajesk
I came across this PKGX tool the other day, if anyone here is using it, could you share your experience? I’m wondering how useful it wou...
New
yolo007wizard
I’ve been reading up on Firefly and it looks very impressive. Does this mean faster CPU bound Elixir? i.e. ballpark java speeds? Or at le...
New
ashkan117
I’m wondering how do people structure their JSON Api’s with Phoenix. Using the blogs example, let’s say I have a blogs view like the foll...
New
garrison
I have been thinking about how I might write a new web framework in Elixir. (Not committing to anything, just thinking about it.) One th...
New
derpycoder
So, anyone got a chance to look at this?!? I’m kind of glad this came along. We can just throw this into our Auth pages and won’t have t...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
Crowdhailer
It is rare to use direct calls to send in elixir. The call is normally wrapped in a function which is responsible for sending the correct...
New
AstonJ
Inspired by Andrew’s post in another thread about types: If the main benefit of static typing is to catch errors, and most people think...
New

Other popular topics Top

openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement