GNU bug report logs - #62609
29.0.60; [PATCH] src/comp.c: New variable `comp-el-to-eln-strip-prefix` for `comp-el-to-eln-rel-filename`

Previous Next

Package: emacs;

Reported by: lin Sun <sunlin7 <at> yahoo.com>

Date: Sun, 2 Apr 2023 05:14:02 UTC

Severity: normal

Tags: patch, wontfix

Found in version 29.0.60

Done: Eli Zaretskii <eliz <at> gnu.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 62609 in the body.
You can then email your comments to 62609 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 bug-gnu-emacs <at> gnu.org:
bug#62609; Package emacs. (Sun, 02 Apr 2023 05:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to lin Sun <sunlin7 <at> yahoo.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 02 Apr 2023 05:14:02 GMT) Full text and rfc822 format available.

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

From: lin Sun <sunlin7 <at> yahoo.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: 29.0.60;
 [PATCH] src/comp.c: New variable `comp-el-to-eln-strip-prefix`
 for `comp-el-to-eln-rel-filename`
Date: Sun, 2 Apr 2023 05:13:28 +0000
[Message part 1 (text/plain, inline)]
Hi,

The emacs with native compile enabled will always rebuild all the
~/.emacs.d/eln-cache/VER/*.eln files if I moved/copied eln-cache
folder from
/home/userA/.emacs.d/eln-cache/ to
/home/userB/.emacs.d/eln-cache/.

It is caused by the function `comp-el-to-eln-rel-filename` calculating
the hash value from the absolute *.el filename to be the middle of the
eln file name.

The new variable `comp-el-to-eln-strip-prefix` in this patch will
allow moving the eln-cache/ folder without rebuilding *.eln in it.

Please help review this change, Thanks

Best Regards
Lin
[0001-New-variable-comp-el-to-eln-strip-prefix-for-comp-el.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62609; Package emacs. (Sun, 02 Apr 2023 06:03:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: lin Sun <sunlin7 <at> yahoo.com>, Andrea Corallo <akrl <at> sdf.org>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 29.0.60;
 [PATCH] src/comp.c: New variable `comp-el-to-eln-strip-prefix`
 for `comp-el-to-eln-rel-filename`
Date: Sun, 02 Apr 2023 09:02:54 +0300
> From: lin Sun <sunlin7 <at> yahoo.com>
> Date: Sun, 2 Apr 2023 05:13:28 +0000
> 
> The emacs with native compile enabled will always rebuild all the
> ~/.emacs.d/eln-cache/VER/*.eln files if I moved/copied eln-cache
> folder from
> /home/userA/.emacs.d/eln-cache/ to
> /home/userB/.emacs.d/eln-cache/.
> 
> It is caused by the function `comp-el-to-eln-rel-filename` calculating
> the hash value from the absolute *.el filename to be the middle of the
> eln file name.

Thanks.

However, I'm not sure I understand: the names of the *.eln files
reflect the absolute name of the *.el file, so the *.eln files will be
regenerated when the *.el files are moved, not when the eln-cache
directory is moved.  Right?  Then what is the problem you are trying
to fix?

> The new variable `comp-el-to-eln-strip-prefix` in this patch will
> allow moving the eln-cache/ folder without rebuilding *.eln in it.

Sorry, I don't think I agree to this change (assuming I understand it
correctly).  We encode the absolute name of the *.el files in the
names of the *.eln files for a reason, so ignoring arbitrary parts of
those absolute names will lead to dangerous clashes.  Please keep in
mind that, unlike with *.elc files, loading an incorrect *.eln files
can crash Emacs.  So we must be very cautious in which files we allow
to load.

And again, I don't think I understand why moving eln-cache without
moving the source *.el files would require the *.eln files in
eln-cache to be recompiled.  Andrea, what am I missing here?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62609; Package emacs. (Mon, 03 Apr 2023 00:54:02 GMT) Full text and rfc822 format available.

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

From: lin Sun <sunlin7 <at> yahoo.com>
To: 62609 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: 29.0.60;
 [PATCH] src/comp.c: New variable `comp-el-to-eln-strip-prefix`
 for `comp-el-to-eln-rel-filename`
Date: Mon, 3 Apr 2023 00:53:18 +0000
[Message part 1 (text/plain, inline)]
Hi Eli,

Apologize for my wrong comment.
You're right, the patch will allow to relocate/copy an elisp source folder from
/home/userA/.emacs.d/epla/**.el to
/home/userB/.emacs.d/epla/**.el.
So the patch should be the
"0002-New-variable-comp-el-to-eln-strip-prefix-for-comp-el.patch"
attached in this email.

And agree with you, it's dangerous when this variable is configured
with an arbitrary value.
So please feel free to close this ticket. Thanks

Best regards
Lin
[0002-New-variable-comp-el-to-eln-strip-prefix-for-comp-el.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62609; Package emacs. (Mon, 03 Apr 2023 12:34:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: lin Sun <sunlin7 <at> yahoo.com>, Andrea Corallo <akrl <at> sdf.org>
Cc: 62609 <at> debbugs.gnu.org
Subject: Re: 29.0.60;
 [PATCH] src/comp.c: New variable `comp-el-to-eln-strip-prefix`
 for `comp-el-to-eln-rel-filename`
Date: Mon, 03 Apr 2023 15:33:48 +0300
> From: lin Sun <sunlin7 <at> yahoo.com>
> Date: Mon, 3 Apr 2023 00:53:18 +0000
> 
> You're right, the patch will allow to relocate/copy an elisp source folder from
> /home/userA/.emacs.d/epla/**.el to
> /home/userB/.emacs.d/epla/**.el.
> So the patch should be the
> "0002-New-variable-comp-el-to-eln-strip-prefix-for-comp-el.patch"
> attached in this email.
> 
> And agree with you, it's dangerous when this variable is configured
> with an arbitrary value.
> So please feel free to close this ticket. Thanks

I'd like to hear what Andrea thinks about this, before I decide
whether to close.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62609; Package emacs. (Mon, 03 Apr 2023 14:09:01 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62609 <at> debbugs.gnu.org, lin Sun <sunlin7 <at> yahoo.com>
Subject: Re: 29.0.60; [PATCH] src/comp.c: New variable
 `comp-el-to-eln-strip-prefix` for `comp-el-to-eln-rel-filename`
Date: Mon, 03 Apr 2023 14:08:36 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: lin Sun <sunlin7 <at> yahoo.com>
>> Date: Mon, 3 Apr 2023 00:53:18 +0000
>> 
>> You're right, the patch will allow to relocate/copy an elisp source folder from
>> /home/userA/.emacs.d/epla/**.el to
>> /home/userB/.emacs.d/epla/**.el.
>> So the patch should be the
>> "0002-New-variable-comp-el-to-eln-strip-prefix-for-comp-el.patch"
>> attached in this email.
>> 
>> And agree with you, it's dangerous when this variable is configured
>> with an arbitrary value.
>> So please feel free to close this ticket. Thanks
>
> I'd like to hear what Andrea thinks about this, before I decide
> whether to close.

Hi all,

I agree we should not add a new knob in order to move eln-cache without
moving the source *.el.  The use-case sounds like a corner case and this
new variable would be IMO very sensitive to miss configurations.

Best Regards

  Andrea




Added tag(s) wontfix. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 03 Apr 2023 14:38:02 GMT) Full text and rfc822 format available.

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Mon, 03 Apr 2023 14:38:03 GMT) Full text and rfc822 format available.

Notification sent to lin Sun <sunlin7 <at> yahoo.com>:
bug acknowledged by developer. (Mon, 03 Apr 2023 14:38:03 GMT) Full text and rfc822 format available.

Message #24 received at 62609-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 62609-done <at> debbugs.gnu.org, sunlin7 <at> yahoo.com
Subject: Re: 29.0.60; [PATCH] src/comp.c: New variable
 `comp-el-to-eln-strip-prefix` for `comp-el-to-eln-rel-filename`
Date: Mon, 03 Apr 2023 17:37:26 +0300
tags 62609 wontfix
thanks

> From: Andrea Corallo <akrl <at> sdf.org>
> Cc: lin Sun <sunlin7 <at> yahoo.com>, 62609 <at> debbugs.gnu.org
> Date: Mon, 03 Apr 2023 14:08:36 +0000
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> From: lin Sun <sunlin7 <at> yahoo.com>
> >> Date: Mon, 3 Apr 2023 00:53:18 +0000
> >> 
> >> You're right, the patch will allow to relocate/copy an elisp source folder from
> >> /home/userA/.emacs.d/epla/**.el to
> >> /home/userB/.emacs.d/epla/**.el.
> >> So the patch should be the
> >> "0002-New-variable-comp-el-to-eln-strip-prefix-for-comp-el.patch"
> >> attached in this email.
> >> 
> >> And agree with you, it's dangerous when this variable is configured
> >> with an arbitrary value.
> >> So please feel free to close this ticket. Thanks
> >
> > I'd like to hear what Andrea thinks about this, before I decide
> > whether to close.
> 
> Hi all,
> 
> I agree we should not add a new knob in order to move eln-cache without
> moving the source *.el.  The use-case sounds like a corner case and this
> new variable would be IMO very sensitive to miss configurations.

OK, so closing.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 02 May 2023 11:24:05 GMT) Full text and rfc822 format available.

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

Previous Next


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