Subject: 31.0.50; --init-directory sets user-emacs-directory after user eln-cache is set
From: "Jordan Isaacs" <[email-masked]>
To: [email-masked]
Date: Sun, 22 Dec 2024 03:57:01 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

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