Fix hash-table-p errors on 'doom build'

This commit is contained in:
Henrik Lissner 2020-01-30 15:31:30 -05:00
parent c801a70ec7
commit 35364f1dd1
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -120,20 +120,21 @@ declaration) or dependency thereof that hasn't already been."
(straight--make-package-modifications-available)) (straight--make-package-modifications-available))
(if-let (built (if-let (built
(doom-with-package-recipes recipes (package local-repo) (doom-with-package-recipes recipes (package local-repo)
;; Ensure packages with outdated files/bytecode are rebuilt (unless force-p
(let ((build-dir (straight--build-dir package)) ;; Ensure packages with outdated files/bytecode are rebuilt
(repo-dir (straight--repos-dir local-repo))) (let ((build-dir (straight--build-dir package))
(and (or (file-newer-than-file-p repo-dir build-dir) (repo-dir (straight--repos-dir local-repo)))
;; Doesn't make sense to compare el and elc files (and (or (file-newer-than-file-p repo-dir build-dir)
;; when the former isn't a symlink to their source. ;; Doesn't make sense to compare el and elc files
(when straight-use-symlinks ;; when the former isn't a symlink to their source.
(cl-loop for file (when straight-use-symlinks
in (doom-files-in build-dir :match "\\.el$" :full t) (cl-loop for file
for elc-file = (byte-compile-dest-file file) in (doom-files-in build-dir :match "\\.el$" :full t)
if (and (file-exists-p elc-file) for elc-file = (byte-compile-dest-file file)
(file-newer-than-file-p file elc-file)) if (and (file-exists-p elc-file)
return t))) (file-newer-than-file-p file elc-file))
(puthash package t straight--packages-to-rebuild))) return t)))
(puthash package t straight--packages-to-rebuild))))
(straight-use-package (intern package)))) (straight-use-package (intern package))))
(print! (success "Rebuilt %d package(s)") (length built)) (print! (success "Rebuilt %d package(s)") (length built))
(print! (success "No packages need rebuilding")) (print! (success "No packages need rebuilding"))