Repository navigation
Replies: 2 comments
|
Having sat with this, I want to put the smaller option on the table too. Homebrew ships The running-app check in #13041 still looks like the better default to me. A swap under a live process breaks the app silently, and skipping a self-updating one costs nothing it won't recover on its own. But it's a heuristic over |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
mise bootstrap packages upgradereplaced/Applications/Google Chrome.appunder a running Chrome this evening, and every tab opened afterwards came up blank. I'd like to change the upgrade rule forauto_updatescasks so a live app is skipped and left to its own updater. I have a PR ready and will link it below.What happened
My machine config declares its apps through
[bootstrap.packages], about twenty casks, and a machine update task runsmise bootstrap packages upgrade --yesover all of them. Fifteen of those casks declareauto_updates: truein their Homebrew metadata: Chrome, Slack, Zoom, VS Code, Obsidian, Discord, 1Password, Ghostty, OrbStack, and so on.Chrome 153.0.8010.37 had just been published. The running Chrome was 152.0.7977.76 and Keystone hadn't applied the update yet. The upgrade rule for self-updating casks compares the live
CFBundleShortVersionStringwith the cask version, saw 152 behind 153, and swapped the bundle:The 152 browser process kept running, but it launches its renderer, GPU, and network helpers from its own versioned framework directory, which no longer existed. Every new tab rendered blank with an empty title. No crash report and nothing in the system log, just a browser that stopped working until relaunched.
psstill listed the old 152 helpers at a path that no longer resolved.Why the current rule is right, and still not enough
The live-version check is a good decision. It avoids Homebrew's
--greedyhabit of re-downloading apps that already updated themselves, and it only acts when the app is demonstrably behind. The gap is that "behind" and "safe to replace" are different questions. An app that is behind and running is almost always behind because its updater hasn't fired yet, not because it can't update. Replacing the bundle at that moment is the one case where mise does worse than doing nothing.Chrome is the loudest failure, but any app that execs helpers from its bundle after launch has the same shape: Electron apps, Zoom, anything with a crashpad handler.
Proposal
In
installed_skip_reason, forInstallMode::Upgradeon anauto_updatescask, after the live version has been judged outdated, check whether any process is running from inside the owned app bundle. If one is, skip withskipped: installed app is running and updates itself. Nothing else changes:Detection reads
ps -axo comm=and matches by path component, the same shape as thepkgutilcall instate.rs. Chrome's helpers show up underContents/Frameworks/…/Helpers/…, so a component-wisestarts_withon the bundle path catches the browser process and everything it spawned.Things I considered and set aside:
auto_updatescask on upgrade, the way Homebrew'sHOMEBREW_NO_UPGRADE_AUTO_UPDATES_CASKSopt-out does. That reverses a rule that already works and leaves a closed, outdated app behind; it might still earn a place as an explicit setting, but not as the default.quit:stanza does. Too surprising for an unattended--yesrun.All reactions