GNU bug report logs - #44746
28.0.50; [feature/native-comp] Noisy "*Warnings*" buffer shown on start

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Fri, 20 Nov 2020 00:51:02 UTC

Severity: normal

Found in version 28.0.50

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44746 in the body.
You can then email your comments to 44746 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#44746; Package emacs. (Fri, 20 Nov 2020 00:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefan <at> marxist.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 20 Nov 2020 00:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50;
 [feature/native-comp] Noisy "*Warnings*" buffer shown on start
Date: Thu, 19 Nov 2020 16:50:08 -0800
Every time I start Emacs after recompilation or clearing cache, I see a
"*Warnings*" buffer popup in a new window, filled with a large amount of
warnings like these:

Warning (comp): debian-ispell.el:229:17: Warning: assignment to free
variable Disable showing Disable logging
Warning (comp): debian-ispell.el:228:28: Warning: reference to free
variable ‘really-hunspell’ Disable showing Disable logging
Warning (comp): debian-ispell.el:386:16: Warning: reference to free
variable Disable showing Disable logging
Warning (comp): debian-ispell.el:392:16: Warning: reference to free
variable Disable showing Disable logging
Warning (comp): debian-ispell.el:393:16: Warning: reference to free
variable Disable showing Disable logging
Warning (comp): debian-ispell.el:403:24: Warning: assignment to free
variable Disable showing Disable logging
Warning (comp): debian-ispell.el:403:20: Warning: reference to free
variable Disable showing Disable logging
[...]
Warning (comp): init-general.el:44:7: Warning: assignment to free
variable Disable showing Disable logging
Warning (comp): init-general.el:45:7: Warning: assignment to free
variable Disable showing Disable logging
Warning (comp): init-general.el:47:7: Warning: assignment to free
variable ‘Man-width’ Disable showing Disable logging
[...]

(The file init-general.el is required from my init file.)

To reproduce this, I would assume it is sufficient to either run Debian,
where the debian-ispell.el file is part of the site-files, or having an
init file requiring a file with, for example, the line:

    (setq display-time-24hr-format t) ; my line 47 above


I'm not exactly sure what the best course of action is here.  But
wouldn't it be better to not show this at all to users, unless they
explicitly ask for it?  As it stands, it is a bit too noisy and
in-your-face, I think.

(I also don't understand why the byte-compiler does not complain about
these variables.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44746; Package emacs. (Fri, 20 Nov 2020 08:32:02 GMT) Full text and rfc822 format available.

Message #8 received at 44746 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 44746 <at> debbugs.gnu.org
Subject: Re: bug#44746: 28.0.50; [feature/native-comp] Noisy "*Warnings*"
 buffer shown on start
Date: Fri, 20 Nov 2020 08:31:18 +0000
Stefan Kangas <stefan <at> marxist.se> writes:

> Every time I start Emacs after recompilation or clearing cache, I see a
> "*Warnings*" buffer popup in a new window, filled with a large amount of
> warnings like these:
>
> Warning (comp): debian-ispell.el:229:17: Warning: assignment to free
> variable Disable showing Disable logging
> Warning (comp): debian-ispell.el:228:28: Warning: reference to free
> variable ‘really-hunspell’ Disable showing Disable logging
> Warning (comp): debian-ispell.el:386:16: Warning: reference to free
> variable Disable showing Disable logging
> Warning (comp): debian-ispell.el:392:16: Warning: reference to free
> variable Disable showing Disable logging
> Warning (comp): debian-ispell.el:393:16: Warning: reference to free
> variable Disable showing Disable logging
> Warning (comp): debian-ispell.el:403:24: Warning: assignment to free
> variable Disable showing Disable logging
> Warning (comp): debian-ispell.el:403:20: Warning: reference to free
> variable Disable showing Disable logging
> [...]
> Warning (comp): init-general.el:44:7: Warning: assignment to free
> variable Disable showing Disable logging
> Warning (comp): init-general.el:45:7: Warning: assignment to free
> variable Disable showing Disable logging
> Warning (comp): init-general.el:47:7: Warning: assignment to free
> variable ‘Man-width’ Disable showing Disable logging
> [...]
>
> (The file init-general.el is required from my init file.)
>
> To reproduce this, I would assume it is sufficient to either run Debian,
> where the debian-ispell.el file is part of the site-files, or having an
> init file requiring a file with, for example, the line:
>
>     (setq display-time-24hr-format t) ; my line 47 above
>
>
> I'm not exactly sure what the best course of action is here.  But
> wouldn't it be better to not show this at all to users, unless they
> explicitly ask for it?  As it stands, it is a bit too noisy and
> in-your-face, I think.
>
> (I also don't understand why the byte-compiler does not complain about
> these variables.)

The byte compiler does not complain because when it compiles these
definitions happen to be present in the compilation environment (read
the file defining these variables was by chance already loaded).  Each
file should be consistent and compilable regardless the load history of
the Emacs used to compile (read specify the correct requires).

Given async compilation start from a fresh Emacs it's more sensitive
into spotting these errors or warnings.

Reporting these messages to the user as warnings was the result of
#44168.  Before #44168 these messages where only reported into the
*Async-native-compile-log*.

This was requested by a number of people because more than one package
missed requiring the feature containing some macro definition.  This
indeed resulted in miscompilations with the diagnostic message being
"hidden" in *Async-native-compile-log*.

Compilation units should *not* rely on the compiler environment for
their definitions.

So yeah these are real warnings or errors and package developers need to
get them somehow.  They could manifest also on non nativecomp builds if
the compilation order or something else chance.  So this is not only a
nice clean-up but also a real fix IMO.

I'm not sure what's the best action we can take to reduce the verbosity
but keep developers informed at the same time.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44746; Package emacs. (Thu, 25 Feb 2021 23:00:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>
Cc: 44746 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#44746: 28.0.50; [feature/native-comp] Noisy "*Warnings*"
 buffer shown on start
Date: Thu, 25 Feb 2021 22:58:54 +0000
Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> Every time I start Emacs after recompilation or clearing cache, I see a
>> "*Warnings*" buffer popup in a new window, filled with a large amount of
>> warnings like these:
>>
>> Warning (comp): debian-ispell.el:229:17: Warning: assignment to free
>> variable Disable showing Disable logging
>> Warning (comp): debian-ispell.el:228:28: Warning: reference to free
>> variable ‘really-hunspell’ Disable showing Disable logging
>> Warning (comp): debian-ispell.el:386:16: Warning: reference to free
>> variable Disable showing Disable logging
>> Warning (comp): debian-ispell.el:392:16: Warning: reference to free
>> variable Disable showing Disable logging
>> Warning (comp): debian-ispell.el:393:16: Warning: reference to free
>> variable Disable showing Disable logging
>> Warning (comp): debian-ispell.el:403:24: Warning: assignment to free
>> variable Disable showing Disable logging
>> Warning (comp): debian-ispell.el:403:20: Warning: reference to free
>> variable Disable showing Disable logging
>> [...]
>> Warning (comp): init-general.el:44:7: Warning: assignment to free
>> variable Disable showing Disable logging
>> Warning (comp): init-general.el:45:7: Warning: assignment to free
>> variable Disable showing Disable logging
>> Warning (comp): init-general.el:47:7: Warning: assignment to free
>> variable ‘Man-width’ Disable showing Disable logging
>> [...]
>>
>> (The file init-general.el is required from my init file.)
>>
>> To reproduce this, I would assume it is sufficient to either run Debian,
>> where the debian-ispell.el file is part of the site-files, or having an
>> init file requiring a file with, for example, the line:
>>
>>     (setq display-time-24hr-format t) ; my line 47 above
>>
>>
>> I'm not exactly sure what the best course of action is here.  But
>> wouldn't it be better to not show this at all to users, unless they
>> explicitly ask for it?  As it stands, it is a bit too noisy and
>> in-your-face, I think.
>>
>> (I also don't understand why the byte-compiler does not complain about
>> these variables.)
>
> The byte compiler does not complain because when it compiles these
> definitions happen to be present in the compilation environment (read
> the file defining these variables was by chance already loaded).  Each
> file should be consistent and compilable regardless the load history of
> the Emacs used to compile (read specify the correct requires).
>
> Given async compilation start from a fresh Emacs it's more sensitive
> into spotting these errors or warnings.
>
> Reporting these messages to the user as warnings was the result of
> #44168.  Before #44168 these messages where only reported into the
> *Async-native-compile-log*.
>
> This was requested by a number of people because more than one package
> missed requiring the feature containing some macro definition.  This
> indeed resulted in miscompilations with the diagnostic message being
> "hidden" in *Async-native-compile-log*.
>
> Compilation units should *not* rely on the compiler environment for
> their definitions.
>
> So yeah these are real warnings or errors and package developers need to
> get them somehow.  They could manifest also on non nativecomp builds if
> the compilation order or something else chance.  So this is not only a
> nice clean-up but also a real fix IMO.
>
> I'm not sure what's the best action we can take to reduce the verbosity
> but keep developers informed at the same time.
>
>   Andrea

To complete this answer, ATM is possible to gate all warnings reported
by async native compilations leveraging the
`comp-async-report-warnings-errors' customize.

Is this sufficient to close this bug or do we like to discuss this
default?

My opinion (got it from the discussion on emacs-devel) is that at least
for now would be good to keep `comp-async-report-warnings-errors' to t
for the reason I've explained in the mail I'm quoting.  Perhaps we could
think about revisiting this default but probably in the future.

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44746; Package emacs. (Thu, 25 Feb 2021 23:00:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44746; Package emacs. (Fri, 26 Feb 2021 00:00:02 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Andrea Corallo <akrl <at> sdf.org>, 
 "Andrea Corallo via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Cc: 44746 <at> debbugs.gnu.org
Subject: Re: bug#44746: 28.0.50; [feature/native-comp] Noisy "*Warnings*"
 buffer shown on start
Date: Thu, 25 Feb 2021 17:59:18 -0600
Andrea Corallo <akrl <at> sdf.org> writes:

>> The byte compiler does not complain because when it compiles these
>> definitions happen to be present in the compilation environment (read
>> the file defining these variables was by chance already loaded).  Each
>> file should be consistent and compilable regardless the load history of
>> the Emacs used to compile (read specify the correct requires).
>>
>> Given async compilation start from a fresh Emacs it's more sensitive
>> into spotting these errors or warnings.
>>
>> Reporting these messages to the user as warnings was the result of
>> #44168.  Before #44168 these messages where only reported into the
>> *Async-native-compile-log*.
>>
>> This was requested by a number of people because more than one package
>> missed requiring the feature containing some macro definition.  This
>> indeed resulted in miscompilations with the diagnostic message being
>> "hidden" in *Async-native-compile-log*.
>>
>> Compilation units should *not* rely on the compiler environment for
>> their definitions.
>>
>> So yeah these are real warnings or errors and package developers need to
>> get them somehow.  They could manifest also on non nativecomp builds if
>> the compilation order or something else chance.  So this is not only a
>> nice clean-up but also a real fix IMO.

(Sorry I didn't reply properly the last time around.)

The above reasoning is correct and valid for any ELisp package, I think.

But most of the warnings I see are actually from my init files.  There,
I specifically do not want to `require' everything I need as that would
slow down startup.  It also places undue burden on mere users that want
to customize this or that option from their init file.

And users can and do customize pretty much anything.  This is Emacs
after all.  So we can't really auto load stuff either...

Perhaps we need some special casing to detect what is an init file and
what is a package?  I have no idea how to do that reliably though, so it
might be a pipe dream.

Or maybe this will all be fixed, for some definition of fixed, when we
flip the default?

>> I'm not sure what's the best action we can take to reduce the verbosity
>> but keep developers informed at the same time.
>>
>>   Andrea
>
> To complete this answer, ATM is possible to gate all warnings reported
> by async native compilations leveraging the
> `comp-async-report-warnings-errors' customize.
>
> Is this sufficient to close this bug or do we like to discuss this
> default?
>
> My opinion (got it from the discussion on emacs-devel) is that at least
> for now would be good to keep `comp-async-report-warnings-errors' to t
> for the reason I've explained in the mail I'm quoting.  Perhaps we could
> think about revisiting this default but probably in the future.

Yes, I agree with the plan to leave the default for now and think about
changing it closer to release.

It is your decision to close this bug or not.  As far as I'm concerned,
I think the necessary clarifications have been made and it is clear that
you are on top of things.  The other option is to mark it as blocking
Emacs 28.1 (Bug#39202) as a reminder.

Thanks again for your hard work on this branch!  I've been using it
daily since August and it is running just fine here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44746; Package emacs. (Fri, 26 Feb 2021 00:00:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44746; Package emacs. (Fri, 26 Feb 2021 07:18:02 GMT) Full text and rfc822 format available.

Message #23 received at 44746 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 44746 <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: Re: bug#44746: 28.0.50;
 [feature/native-comp] Noisy "*Warnings*" buffer shown on start
Date: Fri, 26 Feb 2021 09:17:37 +0200
> Cc: stefan <at> marxist.se
> Date: Thu, 25 Feb 2021 22:58:54 +0000
> From:  Andrea Corallo via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> To complete this answer, ATM is possible to gate all warnings reported
> by async native compilations leveraging the
> `comp-async-report-warnings-errors' customize.
> 
> Is this sufficient to close this bug or do we like to discuss this
> default?

I think we can close this, yes.  Basically, you are saying that most
of these warnings will go away once we get our act together and fix
all the missing 'require's.

Btw, I think the doc string of comp-async-report-warnings-errors could
use some love: as it stands now, I needed to read the code where it is
used to understand what it does, and why it is a defcustom.  Some of
the explanation you, Andrea, wrote in this thread could find its way
into the doc string and make it much more clear.

> My opinion (got it from the discussion on emacs-devel) is that at least
> for now would be good to keep `comp-async-report-warnings-errors' to t
> for the reason I've explained in the mail I'm quoting.

Agreed.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44746; Package emacs. (Fri, 26 Feb 2021 07:20:01 GMT) Full text and rfc822 format available.

Message #26 received at 44746 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 44746 <at> debbugs.gnu.org, akrl <at> sdf.org
Subject: Re: bug#44746: 28.0.50;
 [feature/native-comp] Noisy "*Warnings*" buffer shown on start
Date: Fri, 26 Feb 2021 09:19:39 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Thu, 25 Feb 2021 17:59:18 -0600
> 
> The above reasoning is correct and valid for any ELisp package, I think.
> 
> But most of the warnings I see are actually from my init files.  There,
> I specifically do not want to `require' everything I need as that would
> slow down startup.  It also places undue burden on mere users that want
> to customize this or that option from their init file.

But you could bind that variable to nil when loading those init files,
right?




Reply sent to Andrea Corallo <akrl <at> sdf.org>:
You have taken responsibility. (Fri, 26 Feb 2021 14:28:02 GMT) Full text and rfc822 format available.

Notification sent to Stefan Kangas <stefan <at> marxist.se>:
bug acknowledged by developer. (Fri, 26 Feb 2021 14:28:03 GMT) Full text and rfc822 format available.

Message #31 received at 44746-done <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 44746-done <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: Re: bug#44746: 28.0.50; [feature/native-comp] Noisy "*Warnings*"
 buffer shown on start
Date: Fri, 26 Feb 2021 14:27:26 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Cc: stefan <at> marxist.se
>> Date: Thu, 25 Feb 2021 22:58:54 +0000
>> From:  Andrea Corallo via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> To complete this answer, ATM is possible to gate all warnings reported
>> by async native compilations leveraging the
>> `comp-async-report-warnings-errors' customize.
>> 
>> Is this sufficient to close this bug or do we like to discuss this
>> default?
>
> I think we can close this, yes.  Basically, you are saying that most
> of these warnings will go away once we get our act together and fix
> all the missing 'require's.

Exactly, consider that (I think) most of these warnings are coming from
packages non in emacs.git.  Code in emacs.git being regularly compiled
during the build process in a fresh enviroment is typically cleaner from
this prespective IME.

> Btw, I think the doc string of comp-async-report-warnings-errors could
> use some love: as it stands now, I needed to read the code where it is
> used to understand what it does, and why it is a defcustom.  Some of
> the explanation you, Andrea, wrote in this thread could find its way
> into the doc string and make it much more clear.

Right I tried with ad74b1b2b6, please have a look an let me know in
case.

>> My opinion (got it from the discussion on emacs-devel) is that at least
>> for now would be good to keep `comp-async-report-warnings-errors' to t
>> for the reason I've explained in the mail I'm quoting.
>
> Agreed.
>
> Thanks.

Closing this then.

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44746; Package emacs. (Fri, 26 Feb 2021 14:53:02 GMT) Full text and rfc822 format available.

Message #34 received at 44746 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 44746 <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: Re: bug#44746: 28.0.50; [feature/native-comp] Noisy "*Warnings*"
 buffer shown on start
Date: Fri, 26 Feb 2021 16:52:30 +0200
> From: Andrea Corallo <akrl <at> sdf.org>
> Cc: 44746-done <at> debbugs.gnu.org, stefan <at> marxist.se
> Date: Fri, 26 Feb 2021 14:27:26 +0000
> 
> > Btw, I think the doc string of comp-async-report-warnings-errors could
> > use some love: as it stands now, I needed to read the code where it is
> > used to understand what it does, and why it is a defcustom.  Some of
> > the explanation you, Andrea, wrote in this thread could find its way
> > into the doc string and make it much more clear.
> 
> Right I tried with ad74b1b2b6, please have a look an let me know in
> case.

Thanks, it was very good.  I made some minor improvements (the main of
which is to tell that people who are annoyed by the warnings should
set this to a nil value).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44746; Package emacs. (Fri, 26 Feb 2021 17:27:02 GMT) Full text and rfc822 format available.

Message #37 received at 44746 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 44746 <at> debbugs.gnu.org, akrl <at> sdf.org
Subject: Re: bug#44746: 28.0.50; [feature/native-comp] Noisy "*Warnings*"
 buffer shown on start
Date: Fri, 26 Feb 2021 11:26:10 -0600
Eli Zaretskii <eliz <at> gnu.org> writes:

> But you could bind that variable to nil when loading those init files,
> right?

I would assume it would work, but I haven't tried it.  But that should
solve the issue locally, yes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44746; Package emacs. (Fri, 26 Feb 2021 18:57:02 GMT) Full text and rfc822 format available.

Message #40 received at 44746 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 44746 <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: Re: bug#44746: 28.0.50; [feature/native-comp] Noisy "*Warnings*"
 buffer shown on start
Date: Fri, 26 Feb 2021 18:56:36 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Andrea Corallo <akrl <at> sdf.org>
>> Cc: 44746-done <at> debbugs.gnu.org, stefan <at> marxist.se
>> Date: Fri, 26 Feb 2021 14:27:26 +0000
>> 
>> > Btw, I think the doc string of comp-async-report-warnings-errors could
>> > use some love: as it stands now, I needed to read the code where it is
>> > used to understand what it does, and why it is a defcustom.  Some of
>> > the explanation you, Andrea, wrote in this thread could find its way
>> > into the doc string and make it much more clear.
>> 
>> Right I tried with ad74b1b2b6, please have a look an let me know in
>> case.
>
> Thanks, it was very good.  I made some minor improvements (the main of
> which is to tell that people who are annoyed by the warnings should
> set this to a nil value).

Thanks

  Andrea




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 27 Mar 2021 11:24:06 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 02 Dec 2021 16:40:01 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 142 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.