From b58dc721aa192ed24eb718a40c54636eb8f89c35 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 14 Sep 2023 16:07:13 +0200 Subject: [PATCH] fix: lingering autoloads from inactive packages A package's autoloads aren't expunged from Doom's profile init file, even after that package has been disabled. If a package's autoloads has side-effects, this can lead to void references/function errors. One such case is with php-extras, which will try to call `php-extras-company-setup` after company loads from its autoloads, but this function naturally won't be loaded if the package is disabled. This change fixes this, fully expunging orphaned autoloads on `doom sync`. --- lisp/cli/packages.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/cli/packages.el b/lisp/cli/packages.el index 463172cee..74daa9ea7 100644 --- a/lisp/cli/packages.el +++ b/lisp/cli/packages.el @@ -652,6 +652,7 @@ If ELPA-P, include packages installed with package.el (M-x package-install)." (doom-initialize-packages) (doom-packages--barf-if-incomplete) (print! (start "Purging orphaned packages (for the emperor)...")) + (quiet! (straight-prune-build-cache)) (cl-destructuring-bind (&optional builds-to-purge repos-to-purge repos-to-regraft) (let ((rdirs (and (or repos-p regraft-repos-p) @@ -672,8 +673,7 @@ If ELPA-P, include packages installed with package.el (M-x package-install)." nil (list (if (not builds-p) (ignore (print! (item "Skipping builds"))) - (and (/= 0 (doom-packages--purge-builds builds-to-purge)) - (quiet! (straight-prune-build-cache)))) + (/= 0 (doom-packages--purge-builds builds-to-purge))) (if (not elpa-p) (ignore (print! (item "Skipping elpa packages"))) (/= 0 (doom-packages--purge-elpa)))