unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Native Compile: Example Of Possibly Spurious Warning
@ 2021-05-16 20:51 T.V Raman
  2021-05-17  6:01 ` Eli Zaretskii
  2021-05-17 19:25 ` Andrea Corallo via Emacs development discussions.
  0 siblings, 2 replies; 8+ messages in thread
From: T.V Raman @ 2021-05-16 20:51 UTC (permalink / raw)
  To: emacs-devel

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

Thanks,

--Raman
♉ Id: kg:/m/0285kf1  🦮

-- 

Thanks,

--Raman
♉ Id: kg:/m/0285kf1  🦮



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

* Re: Native Compile: Example Of Possibly Spurious Warning
  2021-05-16 20:51 Native Compile: Example Of Possibly Spurious Warning T.V Raman
@ 2021-05-17  6:01 ` Eli Zaretskii
  2021-05-17 13:58   ` T.V Raman
  2021-05-17 19:25 ` Andrea Corallo via Emacs development discussions.
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2021-05-17  6:01 UTC (permalink / raw)
  To: T.V Raman; +Cc: emacs-devel

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



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

* Re: Native Compile: Example Of Possibly Spurious Warning
  2021-05-17  6:01 ` Eli Zaretskii
@ 2021-05-17 13:58   ` T.V Raman
  2021-05-17 14:16     ` Eli Zaretskii
  2021-05-17 16:12     ` T.V Raman
  0 siblings, 2 replies; 8+ messages in thread
From: T.V Raman @ 2021-05-17 13:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 2145 bytes --]

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



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

* Re: Native Compile: Example Of Possibly Spurious Warning
  2021-05-17 13:58   ` T.V Raman
@ 2021-05-17 14:16     ` Eli Zaretskii
  2021-05-17 19:22       ` Andrea Corallo via Emacs development discussions.
  2021-05-17 16:12     ` T.V Raman
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2021-05-17 14:16 UTC (permalink / raw)
  To: T.V Raman, Andrea Corallo; +Cc: emacs-devel

> From: "T.V Raman" <raman@google.com>
> Cc: emacs-devel@gnu.org
> Date: Mon, 17 May 2021 06:58:17 -0700
> 
> 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

I hope Andrea will look into this and tell what causes the error (my
guess is some other file this one loads or requires, but that's just a
guess).

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

They should all go to ~/.emacs.d/eln-cache/.



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

* Re: Native Compile: Example Of Possibly Spurious Warning
  2021-05-17 13:58   ` T.V Raman
  2021-05-17 14:16     ` Eli Zaretskii
@ 2021-05-17 16:12     ` T.V Raman
  1 sibling, 0 replies; 8+ messages in thread
From: T.V Raman @ 2021-05-17 16:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 3097 bytes --]

"T.V Raman" <raman@google.com> writes:

So I created myself a simple shell script to batch-native-compile all of 
emacspeak  --- installed that in a separate git worktree and did the
build -- no warnings. Before I did this, I cleaned out eln-cache since
earlier I found multiple versions of the .eln files there and I wanted
to make sure it was loading the newest.

Though there were no warnings during the batch compile, the warnings
still show up when Emacs is restarted.

Here is  the  build file I used to native compile all of Emacspeak.

#!/bin/sh
EMACS=/home/raman/sourceforge/emacs/src/emacs

make clean
make config EMACS=$EMACS
make EMACS=$EMACS COMPILE="-f batch-native-compile"
cd lisp && make EMACS=$EMACS COMPILE="-f batch-native-compile" muggles --no-print-directory
make EMACS=$EMACS COMPILE="-f batch-native-compile" extra-muggles --no-print-directory

> 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



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

* Re: Native Compile: Example Of Possibly Spurious Warning
  2021-05-17 14:16     ` Eli Zaretskii
@ 2021-05-17 19:22       ` Andrea Corallo via Emacs development discussions.
  2021-05-17 20:20         ` T.V Raman
  0 siblings, 1 reply; 8+ messages in thread
From: Andrea Corallo via Emacs development discussions. @ 2021-05-17 19:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: T.V Raman, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: "T.V Raman" <raman@google.com>
>> Cc: emacs-devel@gnu.org
>> Date: Mon, 17 May 2021 06:58:17 -0700
>> 
>> 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
>
> I hope Andrea will look into this and tell what causes the error (my
> guess is some other file this one loads or requires, but that's just a
> guess).

I'll be happy to have a look this week.

Raman can you share a sequence precise instructions I can follow to
reproduce what you see?

Thanks

  Andrea



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

* Re: Native Compile: Example Of Possibly Spurious Warning
  2021-05-16 20:51 Native Compile: Example Of Possibly Spurious Warning T.V Raman
  2021-05-17  6:01 ` Eli Zaretskii
@ 2021-05-17 19:25 ` Andrea Corallo via Emacs development discussions.
  1 sibling, 0 replies; 8+ messages in thread
From: Andrea Corallo via Emacs development discussions. @ 2021-05-17 19:25 UTC (permalink / raw)
  To: T.V Raman; +Cc: emacs-devel

"T.V Raman" <raman@google.com> writes:

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

I does not make much sense to me, as mentioned please give us a
reproducer to reproduce this from emacs -Q.

Thanks

  Andrea



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

* Re: Native Compile: Example Of Possibly Spurious Warning
  2021-05-17 19:22       ` Andrea Corallo via Emacs development discussions.
@ 2021-05-17 20:20         ` T.V Raman
  0 siblings, 0 replies; 8+ messages in thread
From: T.V Raman @ 2021-05-17 20:20 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: Eli Zaretskii, emacs-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 2391 bytes --]

Andrea Corallo <akrl@sdf.org> writes:


Hi Andrea,

emacspeak is at https://github.com/tvraman/emacspeak

I've tried many things, including batch native compiling emacspeak  ---
and to ensure that a running Emacs did not end up polluting the
eln-cache, I did this while running an emacs that did not have native
support compiled in.
If after then killing the non-native emacs and start the Emacs with
native support, I still see the warning I showed in my email.

Not sure whether you'll have the cycles to run emacspeak itself --
you'll minimally need to install the espeak and espeak-ng  packages to
get speech synthesis on Linux for Emacspeak to use.

Here is my suspicion:

When emacspeak is ormally compiled via make, it loads it's own loaddefs
file etc ---  and I suspect that when Emacs itself compiles any of the
emacspeak modules while running, it doesn't pull in the prerequisites.

Also: I was hoping that once batch-native-compile had done its thing for
all the emacspeak modules, then a newly started emacs would not need to
compile those files; however this is not true -- with no further changes
to the source-code of those files, Emacs appears to recompile those
files on the fly -- dont know why. I've not fully understood how the
cacheing strategy works, but I suspect it's over-aggressive.

One final thought: for complex packages like Emacspeak that have their
own custom build rules, it would be  nice if emacs' async native compile
cycle could be given access to those rules.




> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: "T.V Raman" <raman@google.com>
>>> Cc: emacs-devel@gnu.org
>>> Date: Mon, 17 May 2021 06:58:17 -0700
>>> 
>>> 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
>>
>> I hope Andrea will look into this and tell what causes the error (my
>> guess is some other file this one loads or requires, but that's just a
>> guess).
>
> I'll be happy to have a look this week.
>
> Raman can you share a sequence precise instructions I can follow to
> reproduce what you see?
>
> Thanks
>
>   Andrea

-- 

Thanks,

--Raman
7©4 Id: kg:/m/0285kf1  •0Ü8



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

end of thread, other threads:[~2021-05-17 20:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-16 20:51 Native Compile: Example Of Possibly Spurious Warning T.V Raman
2021-05-17  6:01 ` Eli Zaretskii
2021-05-17 13:58   ` T.V Raman
2021-05-17 14:16     ` Eli Zaretskii
2021-05-17 19:22       ` Andrea Corallo via Emacs development discussions.
2021-05-17 20:20         ` T.V Raman
2021-05-17 16:12     ` T.V Raman
2021-05-17 19:25 ` Andrea Corallo via Emacs development discussions.

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