               (push file targets)))))
       (when (file-exists-p doom-autoload-file)
         (delete-file doom-autoload-file)
+        (ignore-errors (delete-file (byte-compile-dest-file doom-autoload-file)))
         (message "Deleted old autoloads.el"))
       (message "Generating new autoloads.el")
       (dolist (file (mapcar #'file-truename (reverse targets)))

              (error "✕ Couldn't install %s" package)))
          (message "Installing core packages...done"))))
    ;; autoloads file
    (unless
        (with-demoted-errors "Autoload error: %s"
          (let (byte-compile-warnings)
            (load doom-autoload-file 'noerror 'nomessage 'nosuffix)))
      (unless noninteractive
        (error "No autoloads file! Run make autoloads")))
    (cl-pushnew doom-core-dir load-path :test #'string=))
  ;; initialize Doom core
  (require 'core-os)
  (unless noninteractive


(defvar doom-disabled-packages ()
  "A list of packages that should be ignored by `def-package!'.")

(defvar doom-autoload-excluded-packages '(marshal gh)
  "Packages that have silly or destructive autoload files that try to load
everyone in the universe and their dog, causing errors that make babies cry. No
one wants that.")

(defvar doom-reload-hook nil
  "A list of hooks to run when `doom/reload-load-path' is called.")
