pitchfork boot enable writes version-specific binary paths; brew/mise upgrades break the launchd registration
#544
Replies: 2 comments
|
Good catch — reproducing this on Linux/systemd too, and I think it's broader than the macOS/launchd framing suggests. Repro (Linux, mise, systemd user unit, pitchfork 2.19.0):
# ~/.config/systemd/user/pitchfork.service
[Service]
ExecStart=/home/exedev/.local/share/mise/installs/aqua-jdx-pitchfork/2.19.0/pitchfork supervisor run --bootmise puts the install dir on PATH via its Root cause is in pub static PITCHFORK_BIN: Lazy<PathBuf> = Lazy::new(|| {
current_exe().and_then(|p| p.canonicalize()) …
});fed to One nuance worth flagging before a fix is chosen: on Linux Per-platform refresh (verified on systemd): On the mise-shim point: that concern is real on macOS, but on Linux with the versioned install on PATH (not the shim) the failure is the clean versioned-path case above, not the shim-needs-env case — so a stable symlink would work there. Of the three directions, a detect-and-re-register variant of your option 2 looks lowest-risk cross-platform: when already enabled, compare the registered |
|
sorry that I missed this discussion. it's a real ux gap and I think we should check whether bin path are the same each time sup start (not the time you run boot enable, or you need to remember to do it every time) I'll impl it! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sharing a paper cut from setting up pitchfork on macOS, where the resulting registration is fragile across package-manager upgrades.
pitchfork boot enablegenerates~/Library/LaunchAgents/pitchfork.plistwith the resolved binary path:That path is version-specific. The next
brew upgrade pitchforkinstalls (e.g.) 2.15.0 at a new Cellar path;brew cleanupeventually removes2.14.0/. After that, launchd tries to spawn the missing binary and the supervisor enters the launchd penalty box withEX_CONFIG (78). Symptoms include:launchctl kickstart -k gui/$UID/pitchforkhangs indefinitelypitchfork listreturns "supervisor not running" (despite RunAtLoad=true)pitchfork logs pitchforkis empty (the supervisor never gets to log anything)launchctl print gui/$UID/pitchforkshowslast exit code = 78: EX_CONFIGand the old Cellar path inarguments, even after the plist file on disk has been updatedTo recover I had to walk through:
…after manually rewriting the plist (or running
pitchfork boot disable && pitchfork boot enable).A second compounding factor I hit:
pitchfork boot disable && pitchfork boot enablerewrites the plist file on disk but does not refresh launchd's in-memory cached args. Even after a successful disable+enable, launchd kept trying to launch the old Cellar path until I manuallybootout+bootstrap. From a user's perspective, the recommendeddisable && enablerecovery doesn't actually recover.What works in each ecosystem
Brew has a stable indirection:
/opt/homebrew/bin/pitchforkis a symlink that brew rewrites on upgrade. If the plist pointed at the symlink,brew upgradewould never invalidate the launchd registration.Mise has
~/.local/share/mise/installs/pitchfork/<version>/pitchfork(version-specific) and~/.local/share/mise/shims/pitchforkas a "stable" path. But the shim is a shell script that callsmise exec, which needsMISE_*env and full PATH that launchd's minimal startup environment doesn't provide. So the shim doesn't actually work as a launchd target.Possible directions
pitchfork boot enableshould prefer a stable path when one is available. On macOS, check whetherwhich pitchforkreturns a path under/opt/homebrew/bin/or/usr/local/bin/; if so, write that. Otherwise fall back to the current resolved-path behavior.pitchfork boot enable(andboot disable) should also dolaunchctl bootout+bootstrapso the on-disk plist change actually propagates to launchd.boot enabledocs could note thatbrew upgrade pitchfork(or any version bump that changes the install path) requires regenerating the plist + bouncing launchd.#1+#2together would mean brew users never have to think about this again —brew upgrade pitchfork && launchctl kickstart -k gui/$UID/pitchforkwould suffice. Mise users would still need to regenerate manually because there's no stable path that works under launchd.All reactions