Detect stale native module before module-load via sidecar#267
Merged
Conversation
920a4d2 to
82dd0d8
Compare
Add support for Ghostty's `bold-color` configuration, allowing bold text to be rendered using bright colors or a specific fixed color. Summary of changes: - src/terminal.zig: Add `BoldConfig` and `bold_config` field to `Terminal`. - src/module.zig: Add `ghostel--set-bold-config` to update bold settings. - src/render.zig: Implement color substitution logic in `readCellProps`. Bold text with palette colors 0-7 is mapped to 8-15. Bold text with default foreground uses `bold_config.fixed_color` if mode is `fixed`. - lisp/ghostel.el: Add `ghostel-bold-color` defcustom (default `bright`) and logic to apply it to new and existing terminals. - test/ghostel-test.el: Add unit tests for both 'bright and fixed-color bold modes. - src/emacs.zig: Add `bright` symbol to cached symbols. Matches Ghostty 1.2.0 behavior. > Written by Gemini, tested by me.
When the elisp package is upgraded ahead of the native module, the old .so was mapped into Emacs first and only then checked for version compatibility. By that point a restart was the only way to load the new binary, so users hit two restarts per upgrade and the interactive prompt at M-x ghostel never fired because the early-out at the top of ghostel--load-module short-circuited once the module was loaded. build.zig now writes a ghostel-module.version sidecar next to the binary, and ghostel--download-module / ghostel--install-built-module- on-finish keep it in sync (the downloader resolves /releases/latest/ to the redirected tag). ghostel--load-module consults the sidecar before module-load and refuses to map a stale .so, so a fresh install can be loaded in this same process — no second restart. The interactive version check also runs unconditionally at the tail of ghostel--load-module, so existing installs without a sidecar still surface the install prompt at M-x ghostel instead of only warning. Fixes #256.
82dd0d8 to
76eb36d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #256 — when the elisp package is upgraded ahead of the native module, the old
.sowas mapped into Emacs first and only then checked for version compatibility. By that point a restart was the only way to load the new binary, andM-x ghostelnever re-surfaced the install prompt because the early-out at the top ofghostel--load-moduleshort-circuited once the module was loaded.build.zigwrites aghostel-module.versionsidecar next to the binary;ghostel--download-moduleandghostel--install-built-module-on-finishkeep it in sync (the downloader resolves/releases/latest/to the redirected tag).ghostel--load-moduleconsults the sidecar beforemodule-loadand refuses to map a stale.so, so a fresh install can be loaded in the same Emacs process — no second restart.ghostel--load-module, so existing installs without a sidecar still surface the install prompt atM-x ghostelinstead of only warning.ghostel--install-module-pairhelper that pre-deletes the dest sidecar before moving the.so, so any mid-install failure ends insidecar absent(loader falls back to live check) rather thansidecar stale(loader refuses to map).Notes
src/version.zigis now the single source of truth shared bybuild.zigandsrc/module.zig.build.zig.zonandlisp/ghostel.el's;; Version:/ghostel--minimum-module-versionstill need manual sync at release time (no change there).Test plan
make -j4 allclean (366 elisp tests + 175 native tests + zig unit tests + evil tests + lint).ghostel-test-sidecar-*,ghostel-test-load-module-*).ghostel-test-install-module-pair-*,ghostel-test-download-module-deletes-stale-sidecar-on-failure).zig buildemits a sidecar matchingghostel--module-version.ghostel-module.so+ matching old sidecar, restart Emacs, confirmM-x ghostelprompts and the fresh module loads in-process without a second restart.