straight.el
straight.el copied to clipboard
[BUG] Straight should not conclude these two version strings indicate a different Emacs Version.
What's wrong
Straight is checking (emacs-version) and using it, without sanitizing, to determine the need to build again.
For example:
(emacs-version)
=> "GNU Emacs 28.1 (build 1, x86_64-apple-darwin20.6.0, Carbon Version 164 AppKit 2202.7)
of 2022-08-02"
Which is effectively the same as a build done the next day with the same code.
(emacs-version)
=> "GNU Emacs 28.1 (build 1, x86_64-apple-darwin20.6.0, Carbon Version 164 AppKit 2202.7)
of 2022-08-03"
A sanitized version check could avoid unnecessary errors, for example:
;; draft implementation
(defun straight-emacs-version ()
"Emacs version sanitized."
(let ((version-string (emacs-version)))
(replace-regexp-in-string "^\\(.*\\)\n.*" "\\1" version-string)
Agreed. Even better would probably be to use the emacs-version variable.
What's worse is that a lot of functionality that shouldn't be blocked by this, e.g. (describe-function straight-use-package) ... is. It's infuriating, given the total build time to "fix" it.
Although a quick way to fix it is just to (byte-compile-file "~/.emacs.d/.local/straight/build-nn.n/straight/straight.el")
I'm referring to the Doom Emacs "kill .local & doom sync" style fix.