Homebrew

Homebrew: Cleanup Gets Smarter

Today we're diving into two fantastic pull requests that make Homebrew more reliable and user-friendly. Rex Hall contributed a brilliant fix that prevents cleanup from promising to remove packages it actually can't touch, while Bo98 tackled some tricky deprecation issues with bottle loading. Plus, we've got some nice consistency improvements in our bump command messaging.

Duration: PT3M53S

https://podlog.io/listen/homebrew-5ef2079f/episode/homebrew-cleanup-gets-smarter-1102713c

Transcript

Hey there, developers! Welcome back to another episode of Homebrew - I'm your host, and wow, do we have some satisfying fixes to talk about today, March 12th, 2026. You know those annoying little bugs that make you go "why does it say it's going to do something and then... doesn't?" Well, today's changes are all about making Homebrew behave exactly like you'd expect it to.

Let's jump right into our main story with pull request 21719 from rexmhall09. This one's called "Respect installed dependents during autoremove" and honestly, it's one of those fixes that makes you wonder how we lived without it. Here's the scenario - you run brew cleanup with the autoremove flag, and it cheerfully tells you "Hey, I found 1 unneeded formula I can remove!" But then when it actually tries to remove it, it fails because that formula has dependents that are still installed. Talk about getting your hopes up for nothing, right?

Rex saw this frustration - it was actually linked to issue 13729 that's been hanging around - and decided to do something about it. The solution is beautifully simple: add a safety check that filters out any formulae that uninstall will refuse to remove due to installed dependents. It's only 33 lines of changes across the cleanup code and tests, but the impact is huge. No more false promises from cleanup! And I love that this got some AI assistance with the testing - it's great to see how human creativity and AI tooling can work together to make our tools better.

Our second merged PR comes from Bo98, and this one's a bit more technical but equally important for keeping things running smoothly. It's called "formulary: soften deprecation errors from FromBottleLoader" - and if you've ever dealt with the headaches of deprecating code while maintaining backward compatibility, you'll appreciate this one.

Here's what happened: they deprecated a feature called "no_autobump! because: requires_manual_review" but didn't rebuild the bottles when they removed it. This created a classic problem - existing bottles had stale formulae that started erroring out after the latest deprecations went live. Bo98's fix mimics how they handle similar issues in other parts of the codebase by softening these deprecation errors, basically giving those old bottles some breathing room instead of just crashing.

We also had a couple of nice cleanup commits today. Sam Ford made a small but thoughtful change to make the bump command use semicolons as delimiters in skip messages, matching what they recently updated in the Livecheck skip conditions. It's just one character change, but consistency in user interfaces matters - these little details add up to make Homebrew feel polished and cohesive.

What I love about today's changes is they're all about respecting the user experience. Rex's autoremove fix eliminates confusion and broken promises. Bo98's deprecation work prevents crashes and keeps things stable during transitions. And Sam's delimiter change makes the interface more consistent. These might not be flashy new features, but they're the kind of solid, thoughtful improvements that make a tool genuinely better to use every day.

Today's Focus: If you're working on any cleanup or maintenance tooling, take inspiration from that autoremove fix. Always validate that you can actually do what you're promising to do before you tell the user about it. And when you're deprecating features, think through the transition period - sometimes being gentle and forgiving during that transition serves your users much better than being strict about the rules.

That's a wrap on today's episode! Keep building amazing things, and remember - the best code changes are often the ones that eliminate little daily frustrations. Catch you tomorrow for more Homebrew goodness!