GNU bug report logs - #53675
lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init

Previous Next

Package: emacs;

Reported by: Tom Gillespie <tgbugs <at> gmail.com>

Date: Tue, 1 Feb 2022 04:14:02 UTC

Severity: normal

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53675 in the body.
You can then email your comments to 53675 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#53675; Package emacs. (Tue, 01 Feb 2022 04:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tom Gillespie <tgbugs <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 01 Feb 2022 04:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tom Gillespie <tgbugs <at> gmail.com>
To: Emacs Bug Report <bug-gnu-emacs <at> gnu.org>, Andrea Corallo <akrl <at> sdf.org>
Subject: 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))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53675; Package emacs. (Tue, 01 Feb 2022 11:02:01 GMT) Full text and rfc822 format available.

Message #8 received at 53675 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Tom Gillespie <tgbugs <at> gmail.com>
Cc: 53675 <at> debbugs.gnu.org
Subject: Re: bug#53675: lisp/startup.el; startup--require-comp-safely async
 compile breaks if comp is required in init
Date: Tue, 01 Feb 2022 11:01:15 +0000
Tom Gillespie <tgbugs <at> gmail.com> writes:

> 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.

Hi Tom,

thanks for reporting and debugging this issue.

a92c6191b0 should fix this, could ou please have a try?

Thanks

  Andrea





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53675; Package emacs. (Tue, 01 Feb 2022 15:22:02 GMT) Full text and rfc822 format available.

Message #11 received at 53675 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Tom Gillespie <tgbugs <at> gmail.com>, 53675 <at> debbugs.gnu.org
Subject: Re: bug#53675: lisp/startup.el; startup--require-comp-safely async
 compile breaks if comp is required in init
Date: Tue, 01 Feb 2022 13:44:09 +0100
Andrea Corallo <akrl <at> sdf.org> writes:

> thanks for reporting and debugging this issue.
>
> a92c6191b0 should fix this, could ou please have a try?

Hi Andrea,

I tried that (2c4a24975c) and starting with "emacs -Q" returns:

  defalias: Symbol’s function definition is void: native--compile-async

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53675; Package emacs. (Tue, 01 Feb 2022 15:37:01 GMT) Full text and rfc822 format available.

Message #14 received at 53675 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: Tom Gillespie <tgbugs <at> gmail.com>, 53675 <at> debbugs.gnu.org
Subject: Re: bug#53675: lisp/startup.el; startup--require-comp-safely async
 compile breaks if comp is required in init
Date: Tue, 01 Feb 2022 15:36:09 +0000
Arash Esbati <arash <at> gnu.org> writes:

> Andrea Corallo <akrl <at> sdf.org> writes:
>
>> thanks for reporting and debugging this issue.
>>
>> a92c6191b0 should fix this, could ou please have a try?
>
> Hi Andrea,
>
> I tried that (2c4a24975c) and starting with "emacs -Q" returns:
>
>   defalias: Symbol’s function definition is void: native--compile-async
>
> Best, Arash

Hi Arash,

sorry I just realized I've made a typo in a92c6191b0, as soon as the
savannah repo restarts to work I'll push the fix for it.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53675; Package emacs. (Tue, 01 Feb 2022 16:52:01 GMT) Full text and rfc822 format available.

Message #17 received at 53675 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: Tom Gillespie <tgbugs <at> gmail.com>, 53675 <at> debbugs.gnu.org
Subject: Re: bug#53675: lisp/startup.el; startup--require-comp-safely async
 compile breaks if comp is required in init
Date: Tue, 01 Feb 2022 16:51:38 +0000
> Hi Arash,
> 
> sorry I just realized I've made a typo in a92c6191b0, as soon as the
> savannah repo restarts to work I'll push the fix for it.
> 
>   Andrea

All right pushed as 665ec8946d.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53675; Package emacs. (Tue, 01 Feb 2022 18:06:01 GMT) Full text and rfc822 format available.

Message #20 received at 53675 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Tom Gillespie <tgbugs <at> gmail.com>, 53675 <at> debbugs.gnu.org
Subject: Re: bug#53675: lisp/startup.el; startup--require-comp-safely async
 compile breaks if comp is required in init
Date: Tue, 01 Feb 2022 19:05:01 +0100
Andrea Corallo <akrl <at> sdf.org> writes:

> All right pushed as 665ec8946d.

Thanks, works.

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53675; Package emacs. (Wed, 02 Feb 2022 05:25:01 GMT) Full text and rfc822 format available.

Message #23 received at 53675 <at> debbugs.gnu.org (full text, mbox):

From: Tom Gillespie <tgbugs <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 53675 <at> debbugs.gnu.org, Arash Esbati <arash <at> gnu.org>
Subject: Re: bug#53675: lisp/startup.el; startup--require-comp-safely async
 compile breaks if comp is required in init
Date: Tue, 1 Feb 2022 21:24:13 -0800
> All right pushed as 665ec8946d.

Fixed for me as well. Thanks!
Tom




Reply sent to Andrea Corallo <akrl <at> sdf.org>:
You have taken responsibility. (Wed, 02 Feb 2022 09:13:01 GMT) Full text and rfc822 format available.

Notification sent to Tom Gillespie <tgbugs <at> gmail.com>:
bug acknowledged by developer. (Wed, 02 Feb 2022 09:13:02 GMT) Full text and rfc822 format available.

Message #28 received at 53675-done <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Tom Gillespie <tgbugs <at> gmail.com>
Cc: Arash Esbati <arash <at> gnu.org>, 53675-done <at> debbugs.gnu.org
Subject: Re: bug#53675: lisp/startup.el; startup--require-comp-safely async
 compile breaks if comp is required in init
Date: Wed, 02 Feb 2022 09:12:05 +0000
Tom Gillespie <tgbugs <at> gmail.com> writes:

>> All right pushed as 665ec8946d.
>
> Fixed for me as well. Thanks!
> Tom

Thanks all for checking, closing.

  Andrea




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 02 Mar 2022 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 112 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.