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
Phil just posted this on EFS: …interesting that some of the key updates to JavaScript appear heavily influenced by (or blatantly copied...
New
adamu
When starting a new project, do you have any go-to libraries you pull in out of habit/preference? For example, Ash, Credo, Mox, ExMachin...
New
Morzaram
Hey everyone. I’m feeling a bit conflicted. I’ve learned Flutter and built a somewhat MVP of this app. I’m a solo dev and throughout this...
New
markmark206
Every time I build a web app, I worry about a bunch of basic things (persisting data, knowing when to compute which things, keeping thing...
New
tcoopman
Yesterday I watched OpenTelemetry: From Desire to Dashboard and it triggered me to take a new look at telemetry in Elixir. But I don’t k...
New
dogweather
I realized I could really use something like this in my Phoenix project: I asked Claude 4 Sonnet if a port exists - it said no, and ga...
New
bartblast
I recently started a discussion about reactive patterns in Hologram, but I realized I need to step back and design the composability arch...
New
AstonJ
Posting this as a separate thread as I’m sure lots of people will be curious - what will the (or the intended) differences be and when mi...
New
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New
PragTob
:wave: I’m currently extracting the statistics calculation part from benchee and stumbled upon how to present error conditions. In the c...
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
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
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
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
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
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