unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "N. Jackson" <njackson@posteo.net>
Cc: 73303@debbugs.gnu.org
Subject: bug#73303: 30.0.91; Native compiler repeatedly interrupts at random moments
Date: Mon, 16 Sep 2024 21:42:24 +0300	[thread overview]
Message-ID: <867cbbcuen.fsf@gnu.org> (raw)
In-Reply-To: <87wmjbmpnt.fsf@moondust.awandering> (njackson@posteo.net)

tags 73303 notabug
thanks

> From: "N. Jackson" <njackson@posteo.net>
> Date: Mon, 16 Sep 2024 18:14:46 +0000
> 
> 
> Since building Emacs 30.0.91, I have repeatedly been interrupted in
> my work by warnings from the native compiler.
> 
> A few examples of the warnings are:
> 
>   Warning (native-compiler): ~/.config/emacs/modules/cdlatex.el:1025:26: Warning: the function ‘reftex-what-environment’ is not known to be defined.
>   Warning (native-compiler): python-el-fgallina-expansions.el:161:10: Warning: the function ‘python-nav-end-of-block’ is not known to be defined.
>   Warning (native-compiler): python-el-fgallina-expansions.el:138:8: Warning: the function ‘python-util-forward-comment’ is not known to be defined.
>   Warning (native-compiler): python-el-fgallina-expansions.el:94:4: Warning: the function ‘python-nav-beginning-of-statement’ is not known to be defined.
>   Warning (native-compiler): python-el-fgallina-expansions.el:92:4: Warning: the function ‘python-nav-end-of-statement’ is not known to be defined.
>   Warning (native-compiler): python-el-fgallina-expansions.el:62:31: Warning: the function ‘python-syntax-context’ is not known to be defined.
>   Warning (native-compiler): python-el-fgallina-expansions.el:39:39: Warning: the function ‘python-indent’ is not known to be defined.
>   Warning (native-compiler): python-el-fgallina-expansions.el:37:40: Warning: the function ‘python-info-ppss-context’ is not known to be defined.

These warnings usually mean that the offending Lisp file lacks some
'require's.  JIT native compilation runs in a separate Emacs session,
which only loads the file it compiles, so any missing 'require's or
autoloading cookies trigger these warnings, whereas when the same
packages are loaded into your main Emacs session, they can benefit
from packages loaded earlier in the session.

IOW, these are minor bugs in the compiled files which need to be fixed
in those files and by their respective developers.

> This behaviour is quite annoying and I wonder if it would not be
> better if the native compiler compiled everything when Emacs is
> started and reported all the errors/warnings then.

You can disable these warnings if you are annoyed by them.  They are
just warnings, and will not usually cause any problems when using the
compiled code.  See native-comp-async-report-warnings-errors.

You can cause these compilations to happen at the beginning of your
Emacs session if you change your init files such that Emacs loads all
these files.  JIT native compilation is triggered by loading a .elc
file that doesn't yet have a corresponding .eln file, so by loading
them at the beginning, you will force Emacs to native-compile them all
at that time.

In any case, Emacs compiles each Lisp file just once, so you should
only see these when you start a new Emacs version for the first time.

> I supoose that might increase Emacs startup time which for some
> users would be unacceptable, but maybe it could happen the first
> time Emacs is started and after updating packages and after changing
> configuration.

It shouldn't increase startup time because the compilation is run in
separate processes, and those use other CPU cores.  Emacs doesn't wait
for the compilation to end before using a package; it uses the byte
code until the native compilation ends, and then loads the
native-compiled code when the compilation ends to replace the byte
code.

I see no bug in what you describe.





  reply	other threads:[~2024-09-16 18:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16 18:14 bug#73303: 30.0.91; Native compiler repeatedly interrupts at random moments N. Jackson
2024-09-16 18:42 ` Eli Zaretskii [this message]
2024-09-16 19:27   ` Andrea Corallo
2024-09-18  0:43     ` N. Jackson
     [not found]   ` <87plp2mhj1.fsf@moondust.awandering>
2024-09-17 15:59     ` Eli Zaretskii
2024-09-17 18:46       ` Philip Kaludercic
2024-09-17 19:09         ` N. Jackson
2024-09-17 20:10           ` Philip Kaludercic
2024-09-24 19:13           ` Andrea Corallo
2024-09-17 19:09         ` Eli Zaretskii
2024-09-17 20:09       ` N. Jackson
2024-09-18 11:29         ` Eli Zaretskii
2024-09-24 19:10       ` Andrea Corallo
2024-09-25 11:15         ` Eli Zaretskii
2024-09-25 18:47           ` Andrea Corallo
2024-09-17 16:01   ` N. Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=867cbbcuen.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=73303@debbugs.gnu.org \
    --cc=njackson@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).