Subject: Re: bug#64494: 30.0.50; Recursive load error with native-compile

From: Stefan Monnier <[email-masked]>
Date: Fri, 07 Jul 2023 16:18:16 -0400

> Thanks, but does it allow to put back the change I reverted?

I believe so, yes.

> It isn't in the patch, so I'm not sure if you tried that.

The patch was tested against commit 40492581f9 (i.e. the commit just
before the reversion).

The way it works is that instead of having the C code call
`native--compile-async` (which loads `comp.el`) right in the middle of
loading another file, it delays the call to the next time Emacs waits.
After all `native--compile-async` doesn't do anything immediately urgent
since all it does is schedule a future compilation.

There's another thing I don't quite understand about our code here: why
do we call `native--compile-async` from `defalias` (via
`maybe_defer_native_compilation`) rather than doing it from something
like `after-load-functions`?

        Stefan