bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53675: lisp/startup.el; startup--require-comp-safely async compile b


From: Tom Gillespie
Subject: bug#53675: lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init
Date: Mon, 31 Jan 2022 20:13:22 -0800

async compilation no longer runs on startup if comp
is required during loading of user init files

The issue is from 536a57b72ce11b1bb8d1b34b339424fea6ccbcce
Fix potential native compiler circular dependencies during load

If for whatever reason during the loading of a user init file
the feature 'comp is loaded (e.g. because they have a call to
(use-package queue) in init.el), then startup will not honor
delayed native compilations. Known causes are cases where
(require 'comp) is called directly in an init file, or where
any comp autoload is reached e.g. if a builtin such as
macroexpand is advised during init re: bug#47049.

This took a very long time to debug because the autoloads
make it impossible to grep for the source of the issue.

The underlying issues is that startup--require-comp-safely
assumes that it is guaranteed to be called for the first
time in an state where 'comp has not already been required.
This is not the case since all user init files are loaded
before startup--require-comp-safely is called.

As far as I can tell the issue can be fixed by removing the
unless (featurep 'comp) check. I'm not sure what side effects
removing the check might cause, however it does restore the
expected behavior. The patched version is:

(defun startup--require-comp-safely ()
  "Require the native compiler avoiding circular dependencies."
  ;; Require comp with `comp--loadable' set to nil to break
  ;; circularity.
  (let ((comp--loadable nil))
    (require 'comp))
  (native--compile-async comp--delayed-sources nil 'late)
  (setq comp--delayed-sources nil))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]