From da954aa3617a2abb6e71e3099c17f7c46b82b896 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 29 Jul 2019 20:59:52 +0200 Subject: [PATCH] Improve 'doom build' reporting & checks - Fix 'doom build' not byte-compiling stale dependencies of rebuilt packages. - Fix 'doom build' logging the wrong number of packages that were rebuilt. --- core/cli/packages.el | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/core/cli/packages.el b/core/cli/packages.el index 152a09c18..c51487304 100644 --- a/core/cli/packages.el +++ b/core/cli/packages.el @@ -113,11 +113,17 @@ a list of packages that will be installed." if (and (file-exists-p elc-file) (file-newer-than-file-p file elc-file)) return t)) - (let ((straight--packages-to-rebuild :all) - (straight--packages-not-to-rebuild (make-hash-table :test #'equal))) - (straight-use-package (intern package) nil nil " ")) - (straight--byte-compile-package recipe) - (cl-incf n)))))) + (let ((straight-use-package-pre-build-functions + straight-use-package-pre-build-functions)) + (add-hook 'straight-use-package-pre-build-functions + (lambda (&rest _) (cl-incf n))) + (let ((straight--packages-to-rebuild :all) + (straight--packages-not-to-rebuild (make-hash-table :test #'equal))) + (straight-use-package (intern package) nil nil " ")) + (straight--byte-compile-package recipe) + (dolist (dep (straight--get-dependencies package)) + (when-let (recipe (gethash dep straight--recipe-cache)) + (straight--byte-compile-package recipe))))))))) (if (= n 0) (ignore (print! (success "No packages need rebuilding"))) (doom--finalize-straight)