Subject: Re: bug#74368: 31.0.50; Different warnings between native-compile and native-compile-async

From: Sean Devlin <[email-masked]>
Date: Fri, 22 Nov 2024 11:32:39 -0500

> On Nov 16, 2024, at 4:26 PM, Andrea Corallo <[email-masked]> wrote:
>> 
> 
> Hi Devlin,
> 
> yes this difference is expected, 'native-compile' runs the compilation
> in the loaded Emacs so that all the definitions of loaded packages are
> known to the compiler.  'native-compile-async' runs in a new fresh Emacs
> so all requires need to be there in the compilation unit in order to let
> the compiler be able to load the definitions.
> 
> We have also some doc in (info "(elisp) Native-Compilation Variables")
> which goes like this:
> 
>    A common cause for asynchronous native-compilation to produce
>     warnings is compiling a file that is missing some ‘require’ of a
>     necessary feature.  The feature may be loaded into the main emacs,
>     but because native compilation always starts from a subprocess with
>     a pristine environment, that may not be true for the subprocess.
> 
> Regards
> 
>  Andrea

I see. Thanks for the explanation and the documentation reference!

Sean