unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Andrea Corallo <akrl@sdf.org>
Cc: Eli Zaretskii <eliz@gnu.org>, stefan@marxist.se, 48079@debbugs.gnu.org
Subject: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 06 Jan 2022 12:15:31 -0500	[thread overview]
Message-ID: <jwv5yqwn60n.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <xjfpmp44zgi.fsf@ma.sdf.org> (Andrea Corallo's message of "Thu, 06 Jan 2022 16:10:37 +0000")

Andrea Corallo [2022-01-06 16:10:37] wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
>>> In the plain old byte-compiler, these files are *very* short lived
>>> because they're not created during the compilation itself but only at
>>> the very end when we save the result to a file (and we just do it by
>>> first saving to `foo.elcNNMMPP` and then renaming that to `foo.elc`).
>>> 
>>> Now with `batch-byte-native-compile-for-bootstrap` apparently we "suspend
>>> the byte-compiler" right in the middle of this small time window, i.e. after
>>> writing to `foo.elcNNMMPP` but before its renamed.  Then we call the
>>> native compiler and only once the native compiler is done, we resume the
>>> byte compilation which just renames the file and exits.
>>> 
>>> If that understanding is correct, then I think we may be able to fix the
>>> problem by just changing the moment at which we suspend the byte-compiler:
>>> suspend it *before* it writes to `foo.elcNNMMPP`.
>>
>> Are you sure your description above is accurate?

No, but I haven't heard any indication to the contrary either.

>> We have a backtrace in bug#48978 that shows when we create the
>> .elcXXX temporary file.  My reading of that backtrace is that it's
>> the other way around: native-compilation invokes byte-compile-file,
>> which compiles the Lisp into bytecode, creates the file with
>> make-temp-file, and writes out the bytecode.  It is true that we then
>> defer renaming of the temporary file in this case

I don't see why you say "the other way around".  Maybe you're putting
more emphasis on some detail of what I wrote than what I intended.
The core os what I wrote is that we should change the code so that the
native compilation takes place before the `.elcNNMMPP` file is written
rather than after.

AFAICT the native compiler does not read/need that file because it gets
the same information in a more convenient format straight from
`bytecomp.el`.

> That's correct,

I don't know what "That" refers to.


        Stefan






  parent reply	other threads:[~2022-01-06 17:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 11:10 bug#48079: Temporary files while building after native-comp merge Stefan Kangas
2021-04-28 12:10 ` Eli Zaretskii
2021-04-28 12:30   ` Eli Zaretskii
2021-04-28 13:14     ` Stefan Kangas
2021-04-28 19:27       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-28 21:26         ` Stefan Kangas
2021-04-29  5:14           ` Eli Zaretskii
2021-04-29  8:19             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-29  9:20               ` Eli Zaretskii
2021-04-29 10:15                 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-02 23:38                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-03 17:14                     ` Eli Zaretskii
2022-01-06 16:10                       ` Andrea Corallo
2022-01-06 16:30                         ` Glenn Morris
2022-01-06 16:48                           ` Eli Zaretskii
2022-01-06 17:15                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-01-07 16:30                           ` Andrea Corallo
2022-01-14 15:58                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-29 11:22               ` Stefan Kangas
2021-04-29  8:18           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-02  8:09           ` Lars Ingebrigtsen
2021-05-02 10:12             ` Stefan Kangas
2021-05-02 10:18               ` Lars Ingebrigtsen
2021-05-02 21:36               ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-05  8:35               ` Lars Ingebrigtsen
2021-05-05 12:11                 ` Eli Zaretskii
2021-05-05 12:47                   ` Lars Ingebrigtsen
2021-05-05 14:01                     ` Eli Zaretskii
2021-05-05 14:24                       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-06  9:15                         ` Lars Ingebrigtsen
2021-05-06 10:12                           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-28 19:24     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-24 12:36 ` Lars Ingebrigtsen

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=jwv5yqwn60n.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=48079@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stefan@marxist.se \
    /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).