unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#53675: lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init
@ 2022-02-01  4:13 Tom Gillespie
  2022-02-01 11:01 ` Andrea Corallo
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Gillespie @ 2022-02-01  4:13 UTC (permalink / raw)
  To: 53675, akrl

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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#53675: lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init
  2022-02-01  4:13 bug#53675: lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init Tom Gillespie
@ 2022-02-01 11:01 ` Andrea Corallo
  2022-02-01 12:44   ` Arash Esbati
  0 siblings, 1 reply; 8+ messages in thread
From: Andrea Corallo @ 2022-02-01 11:01 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: 53675

Tom Gillespie <tgbugs@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






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#53675: lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init
  2022-02-01 11:01 ` Andrea Corallo
@ 2022-02-01 12:44   ` Arash Esbati
  2022-02-01 15:36     ` Andrea Corallo
  0 siblings, 1 reply; 8+ messages in thread
From: Arash Esbati @ 2022-02-01 12:44 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: Tom Gillespie, 53675

Andrea Corallo <akrl@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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#53675: lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init
  2022-02-01 12:44   ` Arash Esbati
@ 2022-02-01 15:36     ` Andrea Corallo
  2022-02-01 16:51       ` Andrea Corallo
  0 siblings, 1 reply; 8+ messages in thread
From: Andrea Corallo @ 2022-02-01 15:36 UTC (permalink / raw)
  To: Arash Esbati; +Cc: Tom Gillespie, 53675

Arash Esbati <arash@gnu.org> writes:

> Andrea Corallo <akrl@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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#53675: lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init
  2022-02-01 15:36     ` Andrea Corallo
@ 2022-02-01 16:51       ` Andrea Corallo
  2022-02-01 18:05         ` Arash Esbati
  2022-02-02  5:24         ` Tom Gillespie
  0 siblings, 2 replies; 8+ messages in thread
From: Andrea Corallo @ 2022-02-01 16:51 UTC (permalink / raw)
  To: Arash Esbati; +Cc: Tom Gillespie, 53675

> 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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#53675: lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init
  2022-02-01 16:51       ` Andrea Corallo
@ 2022-02-01 18:05         ` Arash Esbati
  2022-02-02  5:24         ` Tom Gillespie
  1 sibling, 0 replies; 8+ messages in thread
From: Arash Esbati @ 2022-02-01 18:05 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: Tom Gillespie, 53675

Andrea Corallo <akrl@sdf.org> writes:

> All right pushed as 665ec8946d.

Thanks, works.

Best, Arash





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#53675: lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init
  2022-02-01 16:51       ` Andrea Corallo
  2022-02-01 18:05         ` Arash Esbati
@ 2022-02-02  5:24         ` Tom Gillespie
  2022-02-02  9:12           ` Andrea Corallo
  1 sibling, 1 reply; 8+ messages in thread
From: Tom Gillespie @ 2022-02-02  5:24 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: 53675, Arash Esbati

> All right pushed as 665ec8946d.

Fixed for me as well. Thanks!
Tom





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#53675: lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init
  2022-02-02  5:24         ` Tom Gillespie
@ 2022-02-02  9:12           ` Andrea Corallo
  0 siblings, 0 replies; 8+ messages in thread
From: Andrea Corallo @ 2022-02-02  9:12 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: Arash Esbati, 53675-done

Tom Gillespie <tgbugs@gmail.com> writes:

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

Thanks all for checking, closing.

  Andrea





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-02-02  9:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-01  4:13 bug#53675: lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init Tom Gillespie
2022-02-01 11:01 ` Andrea Corallo
2022-02-01 12:44   ` Arash Esbati
2022-02-01 15:36     ` Andrea Corallo
2022-02-01 16:51       ` Andrea Corallo
2022-02-01 18:05         ` Arash Esbati
2022-02-02  5:24         ` Tom Gillespie
2022-02-02  9:12           ` Andrea Corallo

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).