Auto-update /Applications/Emacs.app in post_install#914
Auto-update /Applications/Emacs.app in post_install#914peteWT wants to merge 2 commits intod12frosted:masterfrom
Conversation
After `brew reinstall emacs-plus@XX`, users who previously copied Emacs.app to /Applications may not realize they're still running the old version. The wrapper script now checks version mismatches and prints a warning with the command to update. This addresses confusion seen in issues like d12frosted#912 where users reinstalled emacs-plus but continued running stale binaries. Behavior is unchanged - the warning is informational only.
|
Interesting! Thanks for the idea and PR. My head is already exploding a bit, so will think about it later today / early tomorrow 🙏 Time for a bottle of wine lol. |
|
Thanks for the PR and for digging into this! The problem you identified in #912 is real and frustrating — stale Emacs.app copies in I have some concerns about this specific approach though, and I think the root issue is actually broader than version mismatches. The version check doesn't catch the problem from #912The scenario in #912 plays out like this:
The version check sees Same issue with Implementation concernsEven setting the above aside, there are some practical issues:
A different approach: auto-update in
|
Adopts the approach suggested by @d12frosted: instead of warning about stale /Applications/Emacs.app at runtime, automatically refresh it during post_install. This: - Solves the root cause (d12frosted#912) rather than detecting a symptom - Handles the dylib linkage case (where version is unchanged but binary is stale) - Avoids runtime performance overhead (no --version spawn on launch) - Works in GUI mode (no stderr warning that vanishes) - Also handles Emacs Client.app for @30 and @31 - Gracefully handles permission errors with opoo fallback
|
Revised based on your feedback — you're right that the runtime version check misses the actual #912 scenario (same version, different dylib linkage) and has the performance/GUI visibility issues. This now implements the
No runtime changes — the wrapper script is back to stock. Force-pushed to the same branch. |
Summary
After
brew reinstall emacs-plus@XX, users who previously copied Emacs.app to/Applicationsmay still be running a stale binary. This causes confusing errors like thelibjpeg.9.dylibissue in #912 — the Cellar copy is rebuilt but the/Applicationscopy isn't.This PR adds auto-update logic to
post_install: if an existing/Applications/Emacs.app(or~/Applications/Emacs.app) is detected, it's automatically refreshed from the newly built Cellar copy.Changes
/Applicationscopies inpost_installfor @29, @30, and @31Emacs.appandEmacs Client.app(for @30 and @31)Why post_install instead of runtime check?
Per feedback from @d12frosted:
--versionspawn on every launchMotivation
See #912