emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Native Compile: Example Of Possibly Spurious Warning


From: T.V Raman
Subject: Re: Native Compile: Example Of Possibly Spurious Warning
Date: Mon, 17 May 2021 06:58:17 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:


All of the spurious warnings I'm seeing dont appear in batch compilation
with batch-byte-compile.
Here is the file on Github:

https://github.com/tvraman/emacspeak/blob/master/lisp/emacspeak-preamble.el#L91

Separately: when I batch-byte-compile emacspeak, I pass in commandline
flags that loads emacspeak-loaddefs.el (analogous to Emacs' own
loaddefs.el)
is it possible to batch-native-compile (that function does exist) but I
have no idea where the generated files end up ie if they go somewhere
different than when generated from a running Emacs.


>> From: "T.V Raman" <raman@google.com>
>> Date: Sun, 16 May 2021 13:51:02 -0700 (PDT)
>> 
>> Here is an example.
>> 
>> eak/lisp/emacspeak-preamble.el: Error: Symbol's value as variable is
>> void emacspeak-user-directory Disable showing Disable logging
>> The above file contains this innocent looking defvar:
>> (defvar emacspeak-user-directory (expand-file-name "~/.emacspeak/")
>> "Emacspeak resources, e.g. pronunciation dicts.")
>> 
>> The only library it has required at that point is cl-lib
>> 
>> In the running emacs, the variable emacspeak-user-directory has the
>> expected value:
>> "/home/raman/.emacspeak/"
>> 
>> So why the warning above?
>
> How can we know without seeing the Lisp source file(s) relevant to
> this compilation?  The answer is somewhere in those files.
>
> In general, native-compilation runs in a separate process that doesn't
> inherit the environment and loaded packages of your interactive
> session, so it is more sensitive to problems than when you
> byte-compile the same source from your interactive session.  In
> particular, the Emacs sub-process that runs native-compilation is run
> in the batch mode, which doesn't load your init files.
>
> So you could try byte-compiling the same file from the shell prompt in
> batch mode, as an approximation to what native-compilation does; any
> warning or error you see in this batch byte-compilation will also
> happen in the async native-compilation.

-- 

Thanks,

--Raman
?7?4 Id: kg:/m/0285kf1  ?0?8



reply via email to

[Prev in Thread] Current Thread [Next in Thread]