GNU bug report logs -
#59358
29.0.50; failing to load .eln for init file sets user-init-file to warnings.el
Previous Next
Reported by: Juanma Barranquero <lekktu <at> gmail.com>
Date: Fri, 18 Nov 2022 13:19:01 UTC
Severity: normal
Found in version 29.0.50
Done: Juanma Barranquero <lekktu <at> gmail.com>
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 59358 in the body.
You can then email your comments to 59358 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#59358
; Package
emacs
.
(Fri, 18 Nov 2022 13:19:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 18 Nov 2022 13:19:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
If you use ~/.emacs instead of ~.emacs.d/init.el, and happen to compile
.emacs, Emacs loads .emacs.elc (as it has always done), but the native
compiler does *not* know how to compile it (because it does not know how to
locate its source), so it gives a warning:
022-11-18 02:54:01+0100 Warning (comp): Cannot look up eln file as no
source file was found for d:/Home/.emacs.elc
and then it assigns the user-init-file to the native-compiled warnings.el,
"d:/Home/.emacs.d/native/29.0.50-a4a10996/warnings-28e75f4d-02da775e.eln"
which now, with the fix for bug#59334, ends up pointing to warnings.el:
ELISP> user-init-file
"d:/Devel/emacs/repo/trunk/lisp/emacs-lisp/warnings.el"
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#59358
; Package
emacs
.
(Fri, 18 Nov 2022 14:25:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 59358 <at> debbugs.gnu.org (full text, mbox):
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Fri, 18 Nov 2022 14:17:36 +0100
>
> If you use ~/.emacs instead of ~.emacs.d/init.el, and happen to compile .emacs, Emacs loads .emacs.elc
> (as it has always done), but the native compiler does *not* know how to compile it (because it does not know
> how to locate its source), so it gives a warning:
>
> 022-11-18 02:54:01+0100 Warning (comp): Cannot look up eln file as no source file was found for
> d:/Home/.emacs.elc
I think the solution to that is to special-case ".emacs", in
maybe_swap_for_eln, as a file name that doesn't have to have the .el
extension for this purpose.
> and then it assigns the user-init-file to the native-compiled warnings.el,
>
> "d:/Home/.emacs.d/native/29.0.50-a4a10996/warnings-28e75f4d-02da775e.eln"
>
> which now, with the fix for bug#59334, ends up pointing to warnings.el:
>
> ELISP> user-init-file
> "d:/Devel/emacs/repo/trunk/lisp/emacs-lisp/warnings.el"
That is a separate bug, IMO. Is this because in Fload we set 'found'
to the file name of warnings.el/.eln in this case? If so, we should
prevent this nonsense.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#59358
; Package
emacs
.
(Sat, 19 Nov 2022 09:15:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 59358 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Fri, Nov 18, 2022 at 3:24 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> That is a separate bug, IMO. Is this because in Fload we set 'found'
> to the file name of warnings.el/.eln in this case? If so, we should
> prevent this nonsense.
>
The bug is the consequence of maybe_swap_for_eln calling `display-warning',
which initiates a recursive Fload while user-init-file is still t, so Fload
"records" the current file name.
The easiest fix in my view is to use delayed warnings and avoid the
recursive Fload.
diff --git i/src/lread.c w/src/lread.c
index c28324dc35..2a57f72194 100644
--- i/src/lread.c
+++ w/src/lread.c
@@ -1742,10 +1742,13 @@ maybe_swap_for_eln (bool no_native, Lisp_Object
*filename, int *fd,
Qnil, Qnil)))
return;
- call2 (intern_c_string ("display-warning"),
- Qcomp,
- CALLN (Fformat,
- build_string ("Cannot look up eln file as "
- "no source file was found for
%s"),
- *filename));
+ Vdelayed_warnings_list
+ = Fcons (list2
+ (Qcomp,
+ CALLN (Fformat,
+ build_string ("Cannot look up eln "
+ "file as no source file "
+ "was found for %s"),
+ *filename)),
+ Vdelayed_warnings_list);
return;
}
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#59358
; Package
emacs
.
(Sat, 19 Nov 2022 10:22:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 59358 <at> debbugs.gnu.org (full text, mbox):
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Sat, 19 Nov 2022 10:13:58 +0100
> Cc: 59358 <at> debbugs.gnu.org
>
> On Fri, Nov 18, 2022 at 3:24 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> That is a separate bug, IMO. Is this because in Fload we set 'found'
> to the file name of warnings.el/.eln in this case? If so, we should
> prevent this nonsense.
>
> The bug is the consequence of maybe_swap_for_eln calling `display-warning', which initiates a recursive
> Fload while user-init-file is still t, so Fload "records" the current file name.
>
> The easiest fix in my view is to use delayed warnings and avoid the recursive Fload.
Fine by me.
Andrea, do you agree?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#59358
; Package
emacs
.
(Sun, 20 Nov 2022 19:00:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 59358 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Juanma Barranquero <lekktu <at> gmail.com>
>> Date: Sat, 19 Nov 2022 10:13:58 +0100
>> Cc: 59358 <at> debbugs.gnu.org
>>
>> On Fri, Nov 18, 2022 at 3:24 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
>>
>> That is a separate bug, IMO. Is this because in Fload we set 'found'
>> to the file name of warnings.el/.eln in this case? If so, we should
>> prevent this nonsense.
>>
>> The bug is the consequence of maybe_swap_for_eln calling
>> `display-warning', which initiates a recursive
>> Fload while user-init-file is still t, so Fload "records" the current file name.
>>
>> The easiest fix in my view is to use delayed warnings and avoid the
>> recursive Fload.
>
> Fine by me.
>
> Andrea, do you agree?
Agreed.
Thanks
Andrea
Reply sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
You have taken responsibility.
(Sun, 20 Nov 2022 22:16:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
bug acknowledged by developer.
(Sun, 20 Nov 2022 22:16:01 GMT)
Full text and
rfc822 format available.
Message #22 received at 59358-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
The more serious bug is fixed with this commit:
8ec8decd9f of 2022-11-20
Avoid native compiler setting user-init-file to warnings.el (bug#59358)
I'll open a new bug report with the first issue (the native compiler being
unable to compile .emacs).
[Message part 2 (text/html, inline)]
bug 59358 cloned as bug 59424.
Request was from
Juanma Barranquero <lekktu <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sun, 20 Nov 2022 22:33: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
.
(Mon, 19 Dec 2022 12:24:11 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 243 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.