fix: don't byte-compile profile init file

The performance benefit of doing so has always been questionable or, at
best, negligible, but has caused numerous issues over the years. The
latest one being #8162, where byte-compiling a profile init file with
too many package autoloads would consume more than 255 opcodes, causing
an overflow error.

For simplicity's sake, Doom will no longer byte-compile this file.

Fix: #8162
This commit is contained in:
Henrik Lissner
2024-11-18 18:27:47 -05:00
parent 04c7cf51b4
commit 87a024ee90
3 changed files with 6 additions and 15 deletions

View File

@ -242,7 +242,7 @@ caches them in `doom--profiles'. If RELOAD? is non-nil, refresh the cache."
(doom-initialize-packages)
(let* ((default-directory doom-profile-dir)
(init-dir doom-profile-init-dir-name)
(init-file (doom-profile-init-file doom-profile t)))
(init-file (doom-profile-init-file doom-profile)))
(print! (start "(Re)building profile in %s/...") (path default-directory))
(condition-case-unless-debug e
(with-file-modes #o750
@ -302,14 +302,8 @@ caches them in `doom--profiles'. If RELOAD? is non-nil, refresh the cache."
if (fboundp genfn)
collect (list initfn))))
(current-buffer)))
(print! (start "Byte-compiling %s...") (relpath init-file))
(print-group!
(let ((byte-compile-debug t)
(byte-compile-warnings (if init-file-debug '(suspicious make-local callargs))))
(byte-compile-file init-file)))
(print! (success "Built %s") (byte-compile-dest-file init-file))))
(print! (success "Built %s") (filename init-file))))
(error (delete-file init-file)
(delete-file (byte-compile-dest-file init-file))
(signal 'doom-autoload-error (list init-file e))))))
(defun doom-profile--generate-vars ()