GNU bug report logs - #75022
31.0.50; --init-directory sets user-emacs-directory after user eln-cache is set

Previous Next

Package: emacs;

Reported by: "Jordan Isaacs" <jordan <at> snowytrees.dev>

Date: Sun, 22 Dec 2024 12:00:01 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#75022: closed (31.0.50; --init-directory sets user-emacs-directory
 after user eln-cache is set)
Date: Sat, 04 Jan 2025 12:46:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 04 Jan 2025 14:45:31 +0200
with message-id <86y0zqd9xw.fsf <at> gnu.org>
and subject line Re: bug#75022: 31.0.50; --init-directory sets user-emacs-directory after user eln-cache is set
has caused the debbugs.gnu.org bug report #75022,
regarding 31.0.50; --init-directory sets user-emacs-directory after user eln-cache is set
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
75022: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75022
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: "Jordan Isaacs" <jordan <at> snowytrees.dev>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50;
 --init-directory sets user-emacs-directory after user eln-cache is set
Date: Sun, 22 Dec 2024 03:57:01 -0800
In startup.el, the user-emacs-directory and the user eln-cache are set up before processing command line args.
The user eln-cache is then gets updated after the early-init.el is loaded. This leaves a gap where early-init.el is
loaded without the correct eln-cache directory. This means there will always be a cache miss if the early-init.eln
file was in the `--init-directory`.

To fix this, either `--init-directory` needs to be read before setting up the user eln-cache, or a call to `startup--update-eln-cache` needs to be called after command line args are processed since user-emacs-directory may have changed (from `--init-directory`).


[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrea Corallo <acorallo <at> gnu.org>
Cc: jordan <at> snowytrees.dev, 75022-done <at> debbugs.gnu.org
Subject: Re: bug#75022: 31.0.50; --init-directory sets user-emacs-directory
 after user eln-cache is set
Date: Sat, 04 Jan 2025 14:45:31 +0200
> From: Andrea Corallo <acorallo <at> gnu.org>
> Cc: "Jordan Isaacs" <jordan <at> snowytrees.dev>,  75022 <at> debbugs.gnu.org
> Date: Sun, 29 Dec 2024 06:25:18 -0500
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> Date: Sun, 22 Dec 2024 13:26:04 -0800
> >> From: "Jordan Isaacs" <jordan <at> snowytrees.dev>
> >> Cc: 75022 <at> debbugs.gnu.org
> >> 
> >> Because it is read only, there is no reason not to byte compile everything. I just make it part of the build step when packaging up my configuration.
> >> 
> >> The reasoning for why I byte compile though seems irrelevant, it’s a bug with a simple fix. The eln-cache path isn’t staying in sync with user-emacs-directory. 
> >> 
> >>     (let ((old-face-font-rescale-alist face-font-rescale-alist))
> >>       (unwind-protect
> >> 	  (command-line)
> >> +  (when (featurep 'native-compile)
> >> +     (startup--update-eln-cache))
> >
> > I'm not at all sure it's indeed so simple to change the eln-cache in
> > the middle of a session, but let's hear what Andrea (CC'ed) thinks
> > about this.
> 
> I have nothing in my mind which suggests this should not work, I think
> that if the patch is tested and seems to work we could try it on master.

OK, installed on master, and closing the bug.

Thanks.


This bug report was last modified 195 days ago.

Previous Next


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