Subject: Re: bug#73303: 30.0.91; Native compiler repeatedly interrupts at random moments

From: "N. Jackson" <[email-masked]>
Date: Tue, 17 Sep 2024 20:09:51 +0000

At 18:59 +0300 on Tuesday 2024-09-17, Eli Zaretskii wrote:

To: Eli Zaretskii <[email-masked]>
Cc: Philip Kaludercic <[email-masked]>,  [email-masked],  [email-masked]
Subject: Re: bug#73303: 30.0.91; Native compiler repeatedly interrupts at random moments
From: "N. Jackson" <[email-masked]>
Gcc: nnfolder+archive:sent.2024-09
--text follows this line--
At 18:59 +0300 on Tuesday 2024-09-17, Eli Zaretskii wrote:

> The feedback is always welcome, of course (if my wording somehow
> made an impression it wasn't, I apologize).

No worries.  I very much appreciate the huge amount of work you do
on Emacs and it amazes me that anyone could find time for it all.
So if your messages are sometimes somewhat terse, I can appreciate
them for being concise and I've learned to take them literally, at
face value, without imagining hidden implications.  

> So these issues are not new, and I think Emacs 30 is better
> equipped to deal with them, and gives users more knobs to deal
> with them.

More knobs is good, but probably increases the difficulty of
choosing the defaults.

> If you set native-comp-async-report-warnings-errors to the value
> 'silent', the warnings will be logged in the *Warnings* buffer, where
> you can later review them, but will not be shown in a popup buffer,
> which might distract you when you don't want that.

Thank you for that tip, I'll do that.  [I'll never remember to look
at the *Warnings* buffer, but I can set a hook that runs when Emacs
exits that logs the warnings and sets a TODO in Org to remind me to
look at them at an opportune moment.]

> If your init file arranges for many packages to load only on demand,
> then I don't think there is a way, except summarily compile all the
> packages under your ~/.emacs.d/ directory (assuming that's where you
> install them).

I don't think I do that.  Not deliberately anyway.  Almost all the
packages I use were installed with the package manager through the
list-packages interface, although there a few that comes from my
GNU/Linux distribution.

Here it's ~/.config/emacs/ nowadays, and I could compile everything
there but that wouldn't catch the files from the distro.

>> I don't suppose there's a function
>> native-compile-eagerly-compile-all-dependencies-of-my-init-files-and-do-it-synchronously-right-now?!
>
> We could do that, but before we do' we'd need to come up with a
> find-all-dependecies-of-my-init-files function ;-)

Ha!  Well I don't feel so bad now that I couldn't immediately see
exactly how to do it.

But wouldn't it be as simple as just native compiling everything on
load-path?  After all, if the native compilation that produces the
intrusive warnings is triggered by loading a .elc file, mustn't the
offending file be on the load path?  [Unless the file were loaded
explicitly, I suppose, but that case one could handle separately if
one wanted to -- after all, explicit loads should be easy to find.]
Could there be a native-compile-load-path function?

> The preloaded files are natively compiled as part of the build, but
> the rest are only natively compiled if the build uses the optional
> "ahead-of-time" feature, via a switch to the configure script.

Thank you, I'll add that to the things I turn on when I run
configure.