bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48079: Temporary files while building after native-comp merge


From: Stefan Monnier
Subject: bug#48079: Temporary files while building after native-comp merge
Date: Sun, 02 Jan 2022 18:38:41 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>> Btw, what is the reason that these temporary *.elc files live longer
>> with the native compilation?
>
> Yes, essentially just the fact that compilation takes longer.
>
> When we compile Emacs the makefile uses
> `batch-byte-native-compile-for-bootstrap' to produce both the .elc and
> the .eln.  As the eln is produced as side product of the .elc to have
> the makefile dependecy model work we can't rename the .elc before the
> .eln is also finished even if we could, otherwise in case of
> interruption we may have the .elc produced but not the .eln.

Hmm... IIUC the situation is the following:

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`.


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]