From 7f175ab6d9a0648eac5c8b404f3005eeda829a4d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 29 Aug 2024 15:19:18 -0400 Subject: [PATCH] fix(cli): inconsistent system hash between sessions sxhash doesn't guarantee hashes are consistent across Emacs sessions, so use md5 instead. Also simplifies what's getting hashed; `system-configuration` is a sufficient substitute for both `system-type` and what I wanted to glean from changes in `system-configuration-features`. Amend: 80e9263b85c2 Close: #8030 Ref: #8024 Co-authored-by: yaaama --- lisp/cli/sync.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/cli/sync.el b/lisp/cli/sync.el index 29be2b278..02f68a87f 100644 --- a/lisp/cli/sync.el +++ b/lisp/cli/sync.el @@ -79,7 +79,7 @@ OPTIONS: (when (and old-version (not (equal old-version emacs-version))) (print! (warn "Emacs version has changed since last sync (from %s to %s)") old-version emacs-version) (setq to-rebuild t)) - (when (and (integerp hash) + (when (and (stringp hash) (not (equal hash (doom-sync--system-hash)))) (print! (warn "Your system has changed since last sync")) (setq to-rebuild t)) @@ -113,7 +113,8 @@ OPTIONS: ;;; Helpers (defun doom-sync--system-hash () - (sxhash (list doom-local-dir system-type system-configuration-features))) + (secure-hash + 'md5 (mapconcat #'identity (list doom-local-dir system-configuration)))) (defun doom-sync--abort-warning-h () (print! (warn "Script was abruptly aborted, leaving Doom in an incomplete state!"))