diff --git a/core/cli/packages.el b/core/cli/packages.el index 70bb77d28..7157b2d99 100644 --- a/core/cli/packages.el +++ b/core/cli/packages.el @@ -223,14 +223,25 @@ list remains lean." (defun doom-packages--wait-for-native-compile-jobs () "Wait for all pending async native compilation jobs." - (cl-loop for pending = (doom-packages--native-compile-jobs) - with previous = 0 + (cl-loop with previous = 0 + with timeout = 30 + with timer = 0 + for pending = (doom-packages--native-compile-jobs) while (not (zerop pending)) if (/= previous pending) do (print! (start "\033[KNatively compiling %d files...\033[1A" pending)) - (setq previous pending) + (setq previous pending + timer 0) else do (let ((inhibit-message t)) + (if (> timer timeout) + (cl-loop for file-name being each hash-key of comp-async-compilations + for prc = (gethash file-name comp-async-compilations) + unless (process-live-p prc) + do (setq timer 0) + and do (print! (warn "Native compilation of %S timed out" (path file-name))) + and return (kill-process prc)) + (cl-incf timer 0.1)) (sleep-for 0.1)))) (defun doom-packages--write-missing-eln-errors ()