15 ms·
/me searches changelog for "`brew update` now runs asynchronously and doesn't block the process to install a 3 year-old package." Dismayed, I do not find it. A
by pgt 6y ago
/me searches changelog for "`brew update` now runs asynchronously and doesn't block the process to install a 3 year-old package." Dismayed, I do not find it.
Asynchronous formula updates would IMO save the most Mac man-years of almost any macOS tool.
- fnord123 6y agoOptimizations to brew would save many many watthours. If I were to guess, it would be over a MWh per year.
- Hackbraten 6y agoPRs are welcome.
- c0nsumer 6y agoI feel like it would be a /tremendous/ amount of work to install packages -- which often have dependencies -- asynchronously. When is this really a problem, anyway? You should probably not have something like 'brew update' scheduled to run periodically, as then a broken package could break something unexpectedly. It should really only be run when you're ready to check for broken things, which means you can also schedule it to run when you can deal with waiting for the process to complete.
- jrochkind1 6y agoHomebrew now runs `brew update` before every `brew install`, no? That's how it gets in the way, you just wanted to install a thing, and now you are stuck waiting for `brew update` -- which I feel takes longer than it used to? (You also may be confused between `brew update` and `brew upgrade`. I know I often am!)
- thomaslkjeldsen 6y agoRunning `brew install hello` triggers `brew update` automatically unless the environment variable HOMEBREW_NO_AUTO_UPDATE is set: echo export HOMEBREW_NO_AUTO_UPDATE=1 >> $HOME/.zshrc I do not think it was a wise decision to enable auto update on `brew install` as long time users expect `brew update` and `brew install` to be two separate steps (as it was for years) and because Homebrew no longer operates like `apt` and other package managers. Looks like it was changed in 2016: https://github.com/Homebrew/brew/issues/288 https://github.com/Homebrew/brew/issues/288
- jrochkind1 6y agoIt makes sense semantically to me, and would be fine/preferable if `brew update` only took a few seconds to complete. Cause otherwise I'm not necessarily going to remember to brew update ever, and am going to be getting old formulae. I think I'm not alone, I suspect this was done because too many users were never updating. I am not super familair with how apt works, but I think the "workflows" of brew are already different than typical apt uses, with continuous incremental releases, and users expected to stay up to date with them -- things aren't necessarily going to keep working (installing properly) if you never run `brew update`, and I think many users were not. I do want `brew install` to get me the latest formula for the thing I'm installing. The problem is when it can add several minutes to a `brew install` invocation, interupting my ability to get on with my business. But good to know about the env variable so at least I can choose which tradeoff I want!
- Spiritus 6y agoThen `HOMEBREW_NO_AUTO_UPDATE` is probably for you. > If set, do not automatically update before running brew install, brew upgrade or brew tap.
- amarshall 6y agoIt’s possible to set `HOMEBREW_NO_AUTO_UPDATE` and `HOMEBREW_AUTO_UPDATE_SECS` to somewhat alleviate this. https://docs.brew.sh/Manpage#environment https://docs.brew.sh/Manpage#environment
- notretarded 6y agoWhy is this important
- matsemann 6y agoHow often are you running brew? Not using MacOS anymore, but I mostly did it when configuring the computer the first time, and maybe some more when changing projects. So like two times a year or so.
- chisquared 6y agoYou can set up launchd to run `brew update` and `brew upgrade` regularly -- it's what I do. Don't do this if you're attached to specific versions of any formulae you have installed. You can try `brew pin`ning them though.