unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#48141: 28.0.50; Files left over by native compiler
@ 2021-05-01 14:36 Stefan Monnier
  2021-05-01 14:44 ` Eli Zaretskii
  2021-05-01 16:54 ` Glenn Morris
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Monnier @ 2021-05-01 14:36 UTC (permalink / raw)
  To: 48141

Package: Emacs
Version: 28.0.50


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

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, and maybe we should put them in /tmp?


        Stefan






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#48141: 28.0.50; Files left over by native compiler
  2021-05-01 14:36 bug#48141: 28.0.50; Files left over by native compiler Stefan Monnier
@ 2021-05-01 14:44 ` Eli Zaretskii
  2021-05-01 16:54 ` Glenn Morris
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2021-05-01 14:44 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 48141

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sat, 01 May 2021 10:36:22 -0400
> 
> 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`).
> 
> 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, and maybe we should put them in /tmp?

These are created by byte compiling, they aren't specific to native
compilations.  (AFAIR, we already had them in /tmp at some point, but
moved away of that for some good reasons that I cannot recall?)

I wouldn't be bothered by them, as failed native compilations will
sooner or later pass from the world...





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#48141: 28.0.50; Files left over by native compiler
  2021-05-01 14:36 bug#48141: 28.0.50; Files left over by native compiler Stefan Monnier
  2021-05-01 14:44 ` Eli Zaretskii
@ 2021-05-01 16:54 ` Glenn Morris
  2021-05-02  7:05   ` Lars Ingebrigtsen
  2021-05-03  8:42   ` Gregory Heytings
  1 sibling, 2 replies; 7+ messages in thread
From: Glenn Morris @ 2021-05-01 16:54 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 48141

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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#48141: 28.0.50; Files left over by native compiler
  2021-05-01 16:54 ` Glenn Morris
@ 2021-05-02  7:05   ` Lars Ingebrigtsen
  2021-05-03  8:42   ` Gregory Heytings
  1 sibling, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-02  7:05 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Stefan Monnier, 48141

Glenn Morris <rgm@gnu.org> writes:

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

Well, we could create them in /tmp, and then move them to
lisp/foo.elcABCDEF, and then move them to lisp/foo.elc -- and it's
unlikely that things go wrong between the first and the second move,
which should lead to fewer of these files being left behind them Emacs
segfaults and stuff when generating the .elc files.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#48141: 28.0.50; Files left over by native compiler
  2021-05-01 16:54 ` Glenn Morris
  2021-05-02  7:05   ` Lars Ingebrigtsen
@ 2021-05-03  8:42   ` Gregory Heytings
  2021-05-03 11:49     ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Gregory Heytings @ 2021-05-03  8:42 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Stefan Monnier, 48141


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

Given that requirement (atomicity) and its implication (same partition), 
would it not be better to create these temporary files in a 'tmp' 
subdirectory of their target directory (e.g. 'lisp/tmp' for el files in 
'lisp' and 'lisp/calc/tmp' for el files in 'lisp/calc') instead of using 
random filenames in the target directory itself?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#48141: 28.0.50; Files left over by native compiler
  2021-05-03  8:42   ` Gregory Heytings
@ 2021-05-03 11:49     ` Eli Zaretskii
  2021-05-03 12:11       ` Gregory Heytings
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-05-03 11:49 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: rgm, monnier, 48141

> Date: Mon, 03 May 2021 08:42:08 +0000
> From: Gregory Heytings <gregory@heytings.org>
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 48141@debbugs.gnu.org
> 
> Given that requirement (atomicity) and its implication (same partition), 
> would it not be better to create these temporary files in a 'tmp' 
> subdirectory of their target directory (e.g. 'lisp/tmp' for el files in 
> 'lisp' and 'lisp/calc/tmp' for el files in 'lisp/calc') instead of using 
> random filenames in the target directory itself?

Since they will be in the tree anyway, why does it matter in what
subdirectory they will be deposited?

Using a subdirectory has a disadvantage: you need to create it and
delete it, which can hamper atomicity, and also cause trouble in
parallel builds.  So if the advantage is unclear, I'd rather not go
there.

There's nothing wrong with what we do now, IMO.  We arrived at that
after several iterations, which did try some of the suggestions in
this thread.  If Magit users are annoyed by their popping up
unexpectedly, adding them to .gitignore is TRT and will solve the
issue cleanly and safely.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#48141: 28.0.50; Files left over by native compiler
  2021-05-03 11:49     ` Eli Zaretskii
@ 2021-05-03 12:11       ` Gregory Heytings
  0 siblings, 0 replies; 7+ messages in thread
From: Gregory Heytings @ 2021-05-03 12:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: rgm, monnier, 48141


>> Given that requirement (atomicity) and its implication (same 
>> partition), would it not be better to create these temporary files in a 
>> 'tmp' subdirectory of their target directory (e.g. 'lisp/tmp' for el 
>> files in 'lisp' and 'lisp/calc/tmp' for el files in 'lisp/calc') 
>> instead of using random filenames in the target directory itself?
>
> Since they will be in the tree anyway, why does it matter in what 
> subdirectory they will be deposited?
>

IMO it's easier to manage, both in .gitignore and to clean the temporary 
files.  But it's just a suggestion (inspired by the way maildirs work).





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-05-03 12:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-01 14:36 bug#48141: 28.0.50; Files left over by native compiler Stefan Monnier
2021-05-01 14:44 ` Eli Zaretskii
2021-05-01 16:54 ` Glenn Morris
2021-05-02  7:05   ` Lars Ingebrigtsen
2021-05-03  8:42   ` Gregory Heytings
2021-05-03 11:49     ` Eli Zaretskii
2021-05-03 12:11       ` Gregory Heytings

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