Subject: bug#48141: 28.0.50; Files left over by native compiler

From: Glenn Morris <[email-masked]>
Date: Sat, 01 May 2021 12:54:25 -0400

Stefan Monnier wrote:

> I have a few files apparently left over from failed native compilations.
> They look like `lisp/foo.elcABCDEF` where `ABCDEF` is random
> (presumably chosen by `make-temp-file`).

This is not directly related to native compilation.
This is so creation of .elc files can be atomic (bug#4196).

> I haven't found a way to reproduce the problem, so I'm not sure exactly
> how they got here but maybe we need to take more precautions to remove
> them

I would guess that the only way this can happen is if Emacs dies during
byte-compilation, which is obviously not a normal situation.

> and maybe we should put them in /tmp?

IIUC, the temp files must be on the same partition as the destination
.elc files, else the move would not be atomic.