unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stephen Leake <stephen_leake@stephe-leake.org>
Cc: emacs-devel@gnu.org
Subject: Re: disable automatic native-compilation?
Date: Sat, 09 Jul 2022 20:23:27 +0300	[thread overview]
Message-ID: <83zghi19ps.fsf@gnu.org> (raw)
In-Reply-To: <86h73qi62w.fsf@stephe-leake.org> (message from Stephen Leake on Sat, 09 Jul 2022 09:49:59 -0700)

> From: Stephen Leake <stephen_leake@stephe-leake.org>
> Date: Sat, 09 Jul 2022 09:49:59 -0700
> 
> I've just started using Emacs 28. I'm trying run the ada-mode test
> suite, which lauches a new Emacs instance for each test.
> 
> Now that instance also starts a native-compile process, which slows
> things down (a lot), and does not terminate cleanly when the Emacs
> instance does at the end of the test.

How does it not "terminate cleanly"? what uncleanliness is left?
Please do tell the details.

> I'm on Windows, so this pops up a dialog that I have to acknowledge
> eventually.

What dialog did pop up that you needed to acknowledge? what did it
say?

> The elisp manual section on native compilation does not say how to
> disable it.

That's because we don't see a need for disabling that, in a build that
supports native compilation.  The thought was that people who don't
want native compilation will build Emacs without it in the first
place.

> native-comp-deferred-compilation
> 
> The documentation for this variable says:
>     "If non-nil compile loaded .elc files asynchronously."
> 
> what happens if this is nil? the files are compiled synchronously, or
> not at all?

You will need to compile them by hand in that case.  Automatic native
compilation always works asynchronously, because otherwise it would
have wedged your session for many seconds, something that is
unthinkable.

> So, I suggest:
> 
> - There should be a simple way to completely disable native compilation;
> Emacs should never do anything that I can't control.

I don't necessarily agree.  Emacs doesn't do here anything different
from what it did before: it loads a compiled Lisp library when you
request that.  It only compiles it to native code the first time it is
loaded when no .eln file exists for it, that's all.  But that's a
side effect of loading the natively-compiled Lisp that you requested
in a build that _you_ built with natively-compilation support.

It sounds like you encountered problems in some very special
situation, where you are running tests using sub-processes, and your
test suite was not ready for native-compilation.  So I'm not sure we
should draw far-fetching conclusion from your use case.  But whether
this impression of mine is correct can only be established by
discussing the details of your scenario, which you didn't provide.  I
suggest to submit a detailed bug report.

> If setting native-comp-deferred-compilation nil is the right way to
> do this, it should be documented in the native compilation section
> of the elisp manual.

That variable is not a user variable, it exists for internal use
purposes.  The ELisp manual does document how to disable
native-compilation of a specific file (similarly to how you disable
byte-compilation of a file).

> - When native-comp-available-p returns nil, there should be no errors
> about libgccjit

Please tell the details and present a reproducible recipe (preferably
in a bug report), then we can discuss what happens in that specific
situation.  In general, you are not supposed to override that function
unless you know what you are doing.



  reply	other threads:[~2022-07-09 17:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09 16:49 disable automatic native-compilation? Stephen Leake
2022-07-09 17:23 ` Eli Zaretskii [this message]
2022-07-10 15:10   ` Lynn Winebarger
2022-07-10 15:39     ` Eli Zaretskii
2022-07-10 18:32       ` Lynn Winebarger
2022-07-10 21:54         ` Ken Brown
2022-07-11  1:52           ` Ken Brown
2022-07-11  2:39             ` Lynn Winebarger
2022-07-11 13:37               ` Ken Brown
2022-07-11 13:56                 ` Eli Zaretskii
2022-07-11 17:19                   ` Ken Brown
2022-07-09 22:36 ` Tor Kringeland
2022-07-10  8:58   ` Philip Kaludercic
2022-07-11 12:54   ` Andrea Corallo
2022-07-12 11:04     ` Tor Kringeland
2022-07-12 11:27       ` Tor Kringeland
2022-07-12 13:29         ` Eli Zaretskii
2022-08-06 15:32 ` Lynn Winebarger

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=83zghi19ps.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=stephen_leake@stephe-leake.org \
    /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).