GNU bug report logs -
#48079
Temporary files while building after native-comp merge
Previous Next
Reported by: Stefan Kangas <stefan <at> marxist.se>
Date: Wed, 28 Apr 2021 11:11:02 UTC
Severity: minor
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> Andrea Corallo [2022-01-06 16:10:37] wrote:
>> Eli Zaretskii <eliz <at> 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.
Eli's description of how it works.
BR
Andrea
This bug report was last modified 2 years and 360 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.