GNU bug report logs - #48079
Temporary files while building after native-comp merge

Previous Next

Package: emacs;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48079 in the body.
You can then email your comments to 48079 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to akrl <at> sdf.org, bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Wed, 28 Apr 2021 11:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefan <at> marxist.se>:
New bug report received and forwarded. Copy sent to akrl <at> sdf.org, bug-gnu-emacs <at> gnu.org. (Wed, 28 Apr 2021 11:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: bug-gnu-emacs <at> gnu.org
Subject: Temporary files while building after native-comp merge
Date: Wed, 28 Apr 2021 06:10:06 -0500
Severity: minor

After the native-comp merge, I see temporary files like this while
building:

    lisp/emacs-lisp/cl-generic.elcsEFkYM
    lisp/emacs-lisp/lisp-mode.elcghtoKr
    lisp/emacs-lisp/macroexp.elco2VM6n
    lisp/emacs-lisp/nadvice.elcCtU6Tw
    lisp/emacs-lisp/syntax.elcM42AoI
    lisp/emacs-lisp/tabulated-list.elc0hWK4o

These files show up in "git status" (in my case, more specifically, in
my `magit-status' buffer) if you run that command at the wrong time.

It would be nice if these files could be added to .gitignore or
something so that one doesn't have to see them, even briefly.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Wed, 28 Apr 2021 12:12:01 GMT) Full text and rfc822 format available.

Message #8 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: akrl <at> sdf.org, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Wed, 28 Apr 2021 15:10:43 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Wed, 28 Apr 2021 06:10:06 -0500
> Cc: Andrea Corallo <akrl <at> sdf.org>
> 
> After the native-comp merge, I see temporary files like this while
> building:
> 
>     lisp/emacs-lisp/cl-generic.elcsEFkYM
>     lisp/emacs-lisp/lisp-mode.elcghtoKr
>     lisp/emacs-lisp/macroexp.elco2VM6n
>     lisp/emacs-lisp/nadvice.elcCtU6Tw
>     lisp/emacs-lisp/syntax.elcM42AoI
>     lisp/emacs-lisp/tabulated-list.elc0hWK4o
> 
> These files show up in "git status" (in my case, more specifically, in
> my `magit-status' buffer) if you run that command at the wrong time.
> 
> It would be nice if these files could be added to .gitignore or
> something so that one doesn't have to see them, even briefly.

This is due to some bug, so ignoring these files would not be TRT.
I have no such files, FWIW.

Can you tell by looking at the times of these files when they were
created? is that during your bootstrap following the merge of the
branch?  Is it possible some native-compilation crashed at some point
(in which case these files could be left behind)?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Wed, 28 Apr 2021 12:31:01 GMT) Full text and rfc822 format available.

Message #11 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: stefan <at> marxist.se
Cc: akrl <at> sdf.org, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Wed, 28 Apr 2021 15:30:35 +0300
> Date: Wed, 28 Apr 2021 15:10:43 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 48079 <at> debbugs.gnu.org, akrl <at> sdf.org
> 
> >     lisp/emacs-lisp/cl-generic.elcsEFkYM
> >     lisp/emacs-lisp/lisp-mode.elcghtoKr
> >     lisp/emacs-lisp/macroexp.elco2VM6n
> >     lisp/emacs-lisp/nadvice.elcCtU6Tw
> >     lisp/emacs-lisp/syntax.elcM42AoI
> >     lisp/emacs-lisp/tabulated-list.elc0hWK4o
> > 
> > These files show up in "git status" (in my case, more specifically, in
> > my `magit-status' buffer) if you run that command at the wrong time.

Oh, you mean they appear momentarily, and then disappear?

But then it should also happen when a simple byte-compilation runs,
right?  IOW, it isn't specific to native-comp, right?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Wed, 28 Apr 2021 13:15:02 GMT) Full text and rfc822 format available.

Message #14 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: akrl <at> sdf.org, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Wed, 28 Apr 2021 08:14:00 -0500
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Wed, 28 Apr 2021 15:10:43 +0300
>> From: Eli Zaretskii <eliz <at> gnu.org>
>> Cc: 48079 <at> debbugs.gnu.org, akrl <at> sdf.org
>>
>> >     lisp/emacs-lisp/cl-generic.elcsEFkYM
>> >     lisp/emacs-lisp/lisp-mode.elcghtoKr
>> >     lisp/emacs-lisp/macroexp.elco2VM6n
>> >     lisp/emacs-lisp/nadvice.elcCtU6Tw
>> >     lisp/emacs-lisp/syntax.elcM42AoI
>> >     lisp/emacs-lisp/tabulated-list.elc0hWK4o
>> >
>> > These files show up in "git status" (in my case, more specifically, in
>> > my `magit-status' buffer) if you run that command at the wrong time.
>
> Oh, you mean they appear momentarily, and then disappear?

Correct, sorry for not being more clear.

> But then it should also happen when a simple byte-compilation runs,
> right?  IOW, it isn't specific to native-comp, right?

Hmm, I have never noticed any such files before the native-comp merge
but it is possible that they were there before.  They might just be
staying around longer now, perhaps?

I've now seen them several times over the last couple of days, whereas
I've never seen them before, so something must have changed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Wed, 28 Apr 2021 19:25:02 GMT) Full text and rfc822 format available.

Message #17 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefan <at> marxist.se, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Wed, 28 Apr 2021 19:24:53 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Wed, 28 Apr 2021 15:10:43 +0300
>> From: Eli Zaretskii <eliz <at> gnu.org>
>> Cc: 48079 <at> debbugs.gnu.org, akrl <at> sdf.org
>> 
>> >     lisp/emacs-lisp/cl-generic.elcsEFkYM
>> >     lisp/emacs-lisp/lisp-mode.elcghtoKr
>> >     lisp/emacs-lisp/macroexp.elco2VM6n
>> >     lisp/emacs-lisp/nadvice.elcCtU6Tw
>> >     lisp/emacs-lisp/syntax.elcM42AoI
>> >     lisp/emacs-lisp/tabulated-list.elc0hWK4o
>> > 
>> > These files show up in "git status" (in my case, more specifically, in
>> > my `magit-status' buffer) if you run that command at the wrong time.
>
> Oh, you mean they appear momentarily, and then disappear?

Confirm

> But then it should also happen when a simple byte-compilation runs,
> right?  IOW, it isn't specific to native-comp, right?

Exacly, it's just that native takes longer to complete.

Regards

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Wed, 28 Apr 2021 19:28:02 GMT) Full text and rfc822 format available.

Message #20 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Wed, 28 Apr 2021 19:27:28 +0000
Stefan Kangas <stefan <at> marxist.se> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> Date: Wed, 28 Apr 2021 15:10:43 +0300
>>> From: Eli Zaretskii <eliz <at> gnu.org>
>>> Cc: 48079 <at> debbugs.gnu.org, akrl <at> sdf.org
>>>
>>> >     lisp/emacs-lisp/cl-generic.elcsEFkYM
>>> >     lisp/emacs-lisp/lisp-mode.elcghtoKr
>>> >     lisp/emacs-lisp/macroexp.elco2VM6n
>>> >     lisp/emacs-lisp/nadvice.elcCtU6Tw
>>> >     lisp/emacs-lisp/syntax.elcM42AoI
>>> >     lisp/emacs-lisp/tabulated-list.elc0hWK4o
>>> >
>>> > These files show up in "git status" (in my case, more specifically, in
>>> > my `magit-status' buffer) if you run that command at the wrong time.
>>
>> Oh, you mean they appear momentarily, and then disappear?
>
> Correct, sorry for not being more clear.
>
>> But then it should also happen when a simple byte-compilation runs,
>> right?  IOW, it isn't specific to native-comp, right?
>
> Hmm, I have never noticed any such files before the native-comp merge
> but it is possible that they were there before.  They might just be
> staying around longer now, perhaps?

Nothing should be changed in this respect.

> I've now seen them several times over the last couple of days, whereas
> I've never seen them before, so something must have changed.

I'm wondering, is it a real issue not to have in .gitignore files that
are showing up temporary?

Regards

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Wed, 28 Apr 2021 21:27:02 GMT) Full text and rfc822 format available.

Message #23 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Wed, 28 Apr 2021 16:26:30 -0500
Andrea Corallo <akrl <at> sdf.org> writes:

> I'm wondering, is it a real issue not to have in .gitignore files that
> are showing up temporary?

That depends on your definition of "real issue", I suppose.  ;-)

For me it becomes a real issue because I'm used to be working in the
magit-status buffer while compiling, and that buffer shows all
uncommitted files at the top and any changes at the bottom.  It is
unsettling to have these files show up there occasionally as it makes
the changes "jump" up and down.

But perhaps the fix is as simple as:

diff --git a/.gitignore b/.gitignore
index fcbc9cd7f4..e27ebe36d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -135,6 +135,7 @@ src/gl-stamp
 *.dll
 *.core
 *.elc
+*.elc[0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z]
 *.eln
 *.o
 *.res




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Thu, 29 Apr 2021 05:16:02 GMT) Full text and rfc822 format available.

Message #26 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 48079 <at> debbugs.gnu.org, akrl <at> sdf.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 29 Apr 2021 08:14:51 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Wed, 28 Apr 2021 16:26:30 -0500
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 48079 <at> debbugs.gnu.org
> 
> Andrea Corallo <akrl <at> sdf.org> writes:
> 
> > I'm wondering, is it a real issue not to have in .gitignore files that
> > are showing up temporary?
> 
> That depends on your definition of "real issue", I suppose.  ;-)
> 
> For me it becomes a real issue because I'm used to be working in the
> magit-status buffer while compiling, and that buffer shows all
> uncommitted files at the top and any changes at the bottom.  It is
> unsettling to have these files show up there occasionally as it makes
> the changes "jump" up and down.

Do you have some kind of auto-revert feature turned on?  If not, how
come magit-status even knows these files are created?

> But perhaps the fix is as simple as:
> 
> diff --git a/.gitignore b/.gitignore
> index fcbc9cd7f4..e27ebe36d0 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -135,6 +135,7 @@ src/gl-stamp
>  *.dll
>  *.core
>  *.elc
> +*.elc[0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z]
>  *.eln
>  *.o
>  *.res

Fine with me, if no better solution emerges.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Thu, 29 Apr 2021 08:19:01 GMT) Full text and rfc822 format available.

Message #29 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 29 Apr 2021 08:18:31 +0000
Stefan Kangas <stefan <at> marxist.se> writes:

> Andrea Corallo <akrl <at> sdf.org> writes:
>
>> I'm wondering, is it a real issue not to have in .gitignore files that
>> are showing up temporary?
>
> That depends on your definition of "real issue", I suppose.  ;-)
>
> For me it becomes a real issue because I'm used to be working in the
> magit-status buffer while compiling, and that buffer shows all
> uncommitted files at the top and any changes at the bottom.  It is
> unsettling to have these files show up there occasionally as it makes
> the changes "jump" up and down.

Probably yes :) I use magit while compiling all the time and I never
cared about those files temporary showing up under "Untracked files" (it
can also be collabsed with tab).

> But perhaps the fix is as simple as:
>
> diff --git a/.gitignore b/.gitignore
> index fcbc9cd7f4..e27ebe36d0 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -135,6 +135,7 @@ src/gl-stamp
>  *.dll
>  *.core
>  *.elc
> +*.elc[0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z]
>  *.eln
>  *.o
>  *.res

FWIW LGTM

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Thu, 29 Apr 2021 08:20:02 GMT) Full text and rfc822 format available.

Message #32 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Stefan Kangas <stefan <at> marxist.se>, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 29 Apr 2021 08:19:31 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Stefan Kangas <stefan <at> marxist.se>
>> Date: Wed, 28 Apr 2021 16:26:30 -0500
>> Cc: Eli Zaretskii <eliz <at> gnu.org>, 48079 <at> debbugs.gnu.org
>> 
>> Andrea Corallo <akrl <at> sdf.org> writes:
>> 
>> > I'm wondering, is it a real issue not to have in .gitignore files that
>> > are showing up temporary?
>> 
>> That depends on your definition of "real issue", I suppose.  ;-)
>> 
>> For me it becomes a real issue because I'm used to be working in the
>> magit-status buffer while compiling, and that buffer shows all
>> uncommitted files at the top and any changes at the bottom.  It is
>> unsettling to have these files show up there occasionally as it makes
>> the changes "jump" up and down.
>
> Do you have some kind of auto-revert feature turned on?  If not, how
> come magit-status even knows these files are created?

I believe he's referring to a new invocation of `magit-status' while
compilation is happening.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Thu, 29 Apr 2021 09:21:02 GMT) Full text and rfc822 format available.

Message #35 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: stefan <at> marxist.se, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 29 Apr 2021 12:20:09 +0300
> From: Andrea Corallo <akrl <at> sdf.org>
> Cc: Stefan Kangas <stefan <at> marxist.se>, 48079 <at> debbugs.gnu.org
> Date: Thu, 29 Apr 2021 08:19:31 +0000
> 
> > Do you have some kind of auto-revert feature turned on?  If not, how
> > come magit-status even knows these files are created?
> 
> I believe he's referring to a new invocation of `magit-status' while
> compilation is happening.

Btw, what is the reason that these temporary *.elc files live longer
with the native compilation?  Does the native compilation need the
*.elc file for its processing?  If not, perhaps we could rename or
delete them earlier?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Thu, 29 Apr 2021 10:17:02 GMT) Full text and rfc822 format available.

Message #38 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefan <at> marxist.se, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 29 Apr 2021 10:15:58 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Andrea Corallo <akrl <at> sdf.org>
>> Cc: Stefan Kangas <stefan <at> marxist.se>, 48079 <at> debbugs.gnu.org
>> Date: Thu, 29 Apr 2021 08:19:31 +0000
>> 
>> > Do you have some kind of auto-revert feature turned on?  If not, how
>> > come magit-status even knows these files are created?
>> 
>> I believe he's referring to a new invocation of `magit-status' while
>> compilation is happening.
>
> 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.

  Andrea

> Does the native compilation need the
> *.elc file for its processing?  If not, perhaps we could rename or
> delete them earlier?
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Thu, 29 Apr 2021 11:23:01 GMT) Full text and rfc822 format available.

Message #41 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Andrea Corallo <akrl <at> sdf.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 29 Apr 2021 06:22:12 -0500
Andrea Corallo <akrl <at> sdf.org> writes:

>> Do you have some kind of auto-revert feature turned on?  If not, how
>> come magit-status even knows these files are created?
>
> I believe he's referring to a new invocation of `magit-status' while
> compilation is happening.

Correct, I run that command manually and on purpose.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Sun, 02 May 2021 08:10:01 GMT) Full text and rfc822 format available.

Message #44 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48079 <at> debbugs.gnu.org,
 Andrea Corallo <akrl <at> sdf.org>
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Sun, 02 May 2021 10:09:05 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> But perhaps the fix is as simple as:
>
> diff --git a/.gitignore b/.gitignore
> index fcbc9cd7f4..e27ebe36d0 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -135,6 +135,7 @@ src/gl-stamp
>  *.dll
>  *.core
>  *.elc
> +*.elc[0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z]
>  *.eln
>  *.o
>  *.res

Sounds like a good idea to me.  (But add a comment about what these
files are.)

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Sun, 02 May 2021 10:13:01 GMT) Full text and rfc822 format available.

Message #47 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48079 <at> debbugs.gnu.org,
 Andrea Corallo <akrl <at> sdf.org>
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Sun, 2 May 2021 05:12:24 -0500
[Message part 1 (text/plain, inline)]
tags 48079 - patch
thanks

Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> But perhaps the fix is as simple as:
>>
>> diff --git a/.gitignore b/.gitignore
>> index fcbc9cd7f4..e27ebe36d0 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -135,6 +135,7 @@ src/gl-stamp
>>  *.dll
>>  *.core
>>  *.elc
>> +*.elc[0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z]
>>  *.eln
>>  *.o
>>  *.res
>
> Sounds like a good idea to me.  (But add a comment about what these
> files are.)

Thanks.

But now I am seeing that some of these files have not been deleted in my
tree:

    lisp/emacs-lisp/comp.elcivrXZS
    lisp/window.elc9aaVMg

This might be because I interrupted the build process at some point; I
don't know.

These files don't get removed when I run extraclean or bootstrap.  So if
we just ignore them there is a risk that these files will slowly build
up over time.

Perhaps we should also make sure they get cleaned up when building, as
in the attached.

Another alternative, arguably more correct, would be to figure out
exactly under which circumstances these files gets left over and delete
them there.  (There is a let-bound `kill-emacs-hook' in
`byte-compile-file', which might be a good place to start looking.)
What makes this a bit tricky is that this is somewhat hard to reproduce.
[0001-Delete-temporary-.elcXXXXXX-files-created-when-compi.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Sun, 02 May 2021 10:19:02 GMT) Full text and rfc822 format available.

Message #50 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48079 <at> debbugs.gnu.org,
 Andrea Corallo <akrl <at> sdf.org>
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Sun, 02 May 2021 12:18:35 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> These files don't get removed when I run extraclean or bootstrap.  So if
> we just ignore them there is a risk that these files will slowly build
> up over time.
>
> Perhaps we should also make sure they get cleaned up when building, as
> in the attached.

Makes sense to me.

> Another alternative, arguably more correct, would be to figure out
> exactly under which circumstances these files gets left over and delete
> them there.  (There is a let-bound `kill-emacs-hook' in
> `byte-compile-file', which might be a good place to start looking.)
> What makes this a bit tricky is that this is somewhat hard to reproduce.

Bug#48141 is about this problem, I think.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Sun, 02 May 2021 21:37:01 GMT) Full text and rfc822 format available.

Message #53 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>,
 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Sun, 02 May 2021 21:36:04 +0000
Stefan Kangas <stefan <at> marxist.se> writes:

> tags 48079 - patch
> thanks
>
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Stefan Kangas <stefan <at> marxist.se> writes:
>>
>>> But perhaps the fix is as simple as:
>>>
>>> diff --git a/.gitignore b/.gitignore
>>> index fcbc9cd7f4..e27ebe36d0 100644
>>> --- a/.gitignore
>>> +++ b/.gitignore
>>> @@ -135,6 +135,7 @@ src/gl-stamp
>>>  *.dll
>>>  *.core
>>>  *.elc
>>> +*.elc[0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z]
>>>  *.eln
>>>  *.o
>>>  *.res
>>
>> Sounds like a good idea to me.  (But add a comment about what these
>> files are.)
>
> Thanks.
>
> But now I am seeing that some of these files have not been deleted in my
> tree:
>
>     lisp/emacs-lisp/comp.elcivrXZS
>     lisp/window.elc9aaVMg
>
> This might be because I interrupted the build process at some point; I
> don't know.
>
> These files don't get removed when I run extraclean or bootstrap.  So if
> we just ignore them there is a risk that these files will slowly build
> up over time.
>
> Perhaps we should also make sure they get cleaned up when building, as
> in the attached.

I'm not sure is correct to do that in compile-clean, if there's really a
problem IMO we should isolate it and debug, IIUC having this in
compile-clean could just mask it.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Wed, 05 May 2021 08:36:02 GMT) Full text and rfc822 format available.

Message #56 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48079 <at> debbugs.gnu.org,
 Andrea Corallo <akrl <at> sdf.org>
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Wed, 05 May 2021 10:35:02 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> But now I am seeing that some of these files have not been deleted in my
> tree:
>
>     lisp/emacs-lisp/comp.elcivrXZS
>     lisp/window.elc9aaVMg
>
> This might be because I interrupted the build process at some point; I
> don't know.

I got this, too (several copies of comp.elc<random>), and I was
momentarily confused -- but then I remembered that I had `C-c'd the
compilation.  Since it takes so long to build these files now, that's
probably be a common occurrence.

I guess we can't set up a signal trap to delete the temp file if we're
being interrupted?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Wed, 05 May 2021 12:12:01 GMT) Full text and rfc822 format available.

Message #59 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 48079 <at> debbugs.gnu.org, stefan <at> marxist.se, akrl <at> sdf.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Wed, 05 May 2021 15:11:34 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: Andrea Corallo <akrl <at> sdf.org>,  Eli Zaretskii <eliz <at> gnu.org>,
>   48079 <at> debbugs.gnu.org
> Date: Wed, 05 May 2021 10:35:02 +0200
> 
> I guess we can't set up a signal trap to delete the temp file if we're
> being interrupted?

You mean, in the Makefile?  That won't handle the cases where the
compilation is manually invoked (e.g., from a running Emacs).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Wed, 05 May 2021 12:48:01 GMT) Full text and rfc822 format available.

Message #62 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 48079 <at> debbugs.gnu.org, stefan <at> marxist.se, akrl <at> sdf.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Wed, 05 May 2021 14:47:43 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> I guess we can't set up a signal trap to delete the temp file if we're
>> being interrupted?
>
> You mean, in the Makefile?  That won't handle the cases where the
> compilation is manually invoked (e.g., from a running Emacs).

I'm not actually sure -- I don't know what the possibilities at our
disposal are here, really.  If we can catch this in Emacs, that'd be
nicer...  but can we?

Another thing I'm wondering about is why we write the subr.elc0EdJIV
file at all, and then apparently don't rename it to .elc immediately?
It seems to linger on in that name for a very long time?  But I haven't
actually looked at the code here.

It's easy to reproduce the behaviour here:

touch lisp/subr.el
make
wait a few seconds
C-c C-c a few times

and then you have a subr.elc0EdJIV file or two.

So is it writing the subr.elc0EdJIV file, then doing the .eln
compilation, and then moving subr.elc0EdJIV to subr.elc?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Wed, 05 May 2021 14:03:01 GMT) Full text and rfc822 format available.

Message #65 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 48079 <at> debbugs.gnu.org, stefan <at> marxist.se, akrl <at> sdf.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Wed, 05 May 2021 17:01:34 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: stefan <at> marxist.se,  akrl <at> sdf.org,  48079 <at> debbugs.gnu.org
> Date: Wed, 05 May 2021 14:47:43 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> I guess we can't set up a signal trap to delete the temp file if we're
> >> being interrupted?
> >
> > You mean, in the Makefile?  That won't handle the cases where the
> > compilation is manually invoked (e.g., from a running Emacs).
> 
> I'm not actually sure -- I don't know what the possibilities at our
> disposal are here, really.  If we can catch this in Emacs, that'd be
> nicer...  but can we?

With complicated enough code, sure, we could.

> Another thing I'm wondering about is why we write the subr.elc0EdJIV
> file at all, and then apparently don't rename it to .elc immediately?
> It seems to linger on in that name for a very long time?  But I haven't
> actually looked at the code here.

AFAIR, we rename it atomically when we are done with it.  I guess with
native-compilation it takes longer to "be done with it".

> So is it writing the subr.elc0EdJIV file, then doing the .eln
> compilation, and then moving subr.elc0EdJIV to subr.elc?

Yes, I think so.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Wed, 05 May 2021 14:25:02 GMT) Full text and rfc822 format available.

Message #68 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, stefan <at> marxist.se,
 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Wed, 05 May 2021 14:24:34 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Lars Ingebrigtsen <larsi <at> gnus.org>
>> Cc: stefan <at> marxist.se,  akrl <at> sdf.org,  48079 <at> debbugs.gnu.org
>> Date: Wed, 05 May 2021 14:47:43 +0200
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> >> I guess we can't set up a signal trap to delete the temp file if we're
>> >> being interrupted?
>> >
>> > You mean, in the Makefile?  That won't handle the cases where the
>> > compilation is manually invoked (e.g., from a running Emacs).
>> 
>> I'm not actually sure -- I don't know what the possibilities at our
>> disposal are here, really.  If we can catch this in Emacs, that'd be
>> nicer...  but can we?
>
> With complicated enough code, sure, we could.
>
>> Another thing I'm wondering about is why we write the subr.elc0EdJIV
>> file at all, and then apparently don't rename it to .elc immediately?
>> It seems to linger on in that name for a very long time?  But I haven't
>> actually looked at the code here.
>
> AFAIR, we rename it atomically when we are done with it.  I guess with
> native-compilation it takes longer to "be done with it".

Exactly, we can't rename before the native compilation is done as native
compilation is a side product of byte compilation and the build system
knows only the latter.

>> So is it writing the subr.elc0EdJIV file, then doing the .eln
>> compilation, and then moving subr.elc0EdJIV to subr.elc?
>
> Yes, I think so.

Confirm.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Thu, 06 May 2021 09:16:01 GMT) Full text and rfc822 format available.

Message #71 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefan <at> marxist.se, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 06 May 2021 11:15:01 +0200
Andrea Corallo <akrl <at> sdf.org> writes:

>>> So is it writing the subr.elc0EdJIV file, then doing the .eln
>>> compilation, and then moving subr.elc0EdJIV to subr.elc?
>>
>> Yes, I think so.
>
> Confirm.

Again, I haven't actually looked at the code, so this is totally
uninformed -- but do we have to write the subr.elc0EdJIV file before
doing the .eln compilation?  Can't the .eln compilation work off of the
contents of a buffer instead?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Thu, 06 May 2021 10:13:02 GMT) Full text and rfc822 format available.

Message #74 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefan <at> marxist.se, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 06 May 2021 10:12:02 +0000
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Andrea Corallo <akrl <at> sdf.org> writes:
>
>>>> So is it writing the subr.elc0EdJIV file, then doing the .eln
>>>> compilation, and then moving subr.elc0EdJIV to subr.elc?
>>>
>>> Yes, I think so.
>>
>> Confirm.
>
> Again, I haven't actually looked at the code, so this is totally
> uninformed -- but do we have to write the subr.elc0EdJIV file before
> doing the .eln compilation?  Can't the .eln compilation work off of the
> contents of a buffer instead?

I think it should be possible, ATM is still the byte-complier saving the
.elc buffer and we delay just the final renaming in comp.el, we could
delay the buffer being saved and do it too after the .eln is produced.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Sun, 02 Jan 2022 23:40:01 GMT) Full text and rfc822 format available.

Message #77 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefan <at> marxist.se, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Sun, 02 Jan 2022 18:38:41 -0500
>> 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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Mon, 03 Jan 2022 17:15:02 GMT) Full text and rfc822 format available.

Message #80 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 48079 <at> debbugs.gnu.org, stefan <at> marxist.se, akrl <at> sdf.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Mon, 03 Jan 2022 19:14:17 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  stefan <at> marxist.se,  48079 <at> debbugs.gnu.org
> Date: Sun, 02 Jan 2022 18:38:41 -0500
> 
> 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`.

Are you sure your description above is accurate?  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, but it looks like the "suspend later" idea might
not work?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Thu, 06 Jan 2022 16:11:01 GMT) Full text and rfc822 format available.

Message #83 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefan <at> marxist.se, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 06 Jan 2022 16:10:37 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
>> Cc: Eli Zaretskii <eliz <at> gnu.org>,  stefan <at> marxist.se,  48079 <at> debbugs.gnu.org
>> Date: Sun, 02 Jan 2022 18:38:41 -0500
>> 
>> 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`.
>
> Are you sure your description above is accurate?  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

That's correct, and we do that on purpose in order not to produce the
.elc file before the .eln one is produced.  Otherwise in case of
interruption we might mess-up the build as 'make' is looking at the .elc
files only as targets.

BR
  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Thu, 06 Jan 2022 16:31:01 GMT) Full text and rfc822 format available.

Message #86 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefan <at> marxist.se,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 06 Jan 2022 11:30:26 -0500
Andrea Corallo wrote:

> Otherwise in case of interruption we might mess-up the build as 'make'
> is looking at the .elc files only as targets.

Did you consider using a pattern rule with two targets in the Makefile
to properly express the relationship between .el and .elc/.eln?

See last example in
https://www.gnu.org/software/make/manual/html_node/Pattern-Examples.html




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Thu, 06 Jan 2022 16:49:02 GMT) Full text and rfc822 format available.

Message #89 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 48079 <at> debbugs.gnu.org, stefan <at> marxist.se, monnier <at> iro.umontreal.ca,
 akrl <at> sdf.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 06 Jan 2022 18:48:01 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  48079 <at> debbugs.gnu.org,  stefan <at> marxist.se,  Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date: Thu, 06 Jan 2022 11:30:26 -0500
> 
> Did you consider using a pattern rule with two targets in the Makefile
> to properly express the relationship between .el and .elc/.eln?

The problem here is that the *.eln files end up in a subdirectory of
native-lisp/ whose precise name is only known to Emacs, and so cannot
be easily written.  You need the Emacs binary to be built (which
already introduces some "interesting" dependencies), and you need to
ask Emacs about the name of that subdirectory.

And if that's not enough, there's another complication: some of the
*.eln files need to be in that unknown directory, and some (most) need
to be in its preloaded/ subdirectory.  So we need two different rules
for 2 groups of *.el files, and we need to keep those groups
up-to-date at all times.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Thu, 06 Jan 2022 17:16:01 GMT) Full text and rfc822 format available.

Message #92 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefan <at> marxist.se, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Thu, 06 Jan 2022 12:15:31 -0500
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.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Fri, 07 Jan 2022 16:31:01 GMT) Full text and rfc822 format available.

Message #95 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefan <at> marxist.se, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Fri, 07 Jan 2022 16:30:05 +0000
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Fri, 14 Jan 2022 15:59:01 GMT) Full text and rfc822 format available.

Message #98 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefan <at> marxist.se, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Fri, 14 Jan 2022 10:58:20 -0500
Andrea Corallo [2022-01-07 16:30:05] wrote:
> 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.

But your response seems to say that what I propose can't work, whereas
I can't see in which sense what Eli says contradicts what I say.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48079; Package emacs. (Tue, 24 May 2022 12:37:01 GMT) Full text and rfc822 format available.

Message #101 received at 48079 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Andrea Corallo <akrl <at> sdf.org>, 48079 <at> debbugs.gnu.org
Subject: Re: bug#48079: Temporary files while building after native-comp merge
Date: Tue, 24 May 2022 14:36:02 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> After the native-comp merge, I see temporary files like this while
> building:
>
>     lisp/emacs-lisp/cl-generic.elcsEFkYM
>     lisp/emacs-lisp/lisp-mode.elcghtoKr
>     lisp/emacs-lisp/macroexp.elco2VM6n
>     lisp/emacs-lisp/nadvice.elcCtU6Tw
>     lisp/emacs-lisp/syntax.elcM42AoI
>     lisp/emacs-lisp/tabulated-list.elc0hWK4o
>
> These files show up in "git status" (in my case, more specifically, in
> my `magit-status' buffer) if you run that command at the wrong time.
>
> It would be nice if these files could be added to .gitignore or
> something so that one doesn't have to see them, even briefly.

Andrea fixed this a while ago in Emacs 29, so I'm closing this bug report.

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




bug marked as fixed in version 29.1, send any further explanations to 48079 <at> debbugs.gnu.org and Stefan Kangas <stefan <at> marxist.se> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 24 May 2022 12:37:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 22 Jun 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 136 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.