all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jordan Isaacs" <jordan@snowytrees.dev>
To: "Eli Zaretskii" <eliz@gnu.org>
Cc: 75022@debbugs.gnu.org
Subject: bug#75022: 31.0.50; --init-directory sets user-emacs-directory after user eln-cache is set
Date: Sun, 22 Dec 2024 05:12:47 -0800	[thread overview]
Message-ID: <29d07feb-4886-4edd-b4ea-1f1cd5f63549@app.fastmail.com> (raw)
In-Reply-To: <86ttav6g51.fsf@gnu.org>

> As for the --init-directory, it doesn't affect the search for your
> init files, it only affects the value of user-emacs-directory (for
> looking up other files).

The issue is the `--init-directory` updated the user-emacs-directory, but there
was no corresponding call to update the eln-cache directory (startup--update-eln-cache).
There are comments throughout startup.el about updating the cache directory whenever
user-emacs-directory is changed. It is missing that call post command line evaluation.
 
> So I don't think I understand why you are asking for changes in how
> the startup code works in Emacs.  Please tell more about your use
> case.

I have a read-only directory of my init.el and early-init.el along with the
byte compiled versions of them. So I call emacs with --init-directory:

/nix/store/ln4pwf5blaqiynydrcn344zn7kbfn6vs-emacs-config
├── early-init.el -> /nix/store/qq073crkwrjvpfrfnsbsqq502c8k0a5y-emacs-config-init-1/share/emacs/site-lisp/early-init.el
├── early-init.elc -> /nix/store/qq073crkwrjvpfrfnsbsqq502c8k0a5y-emacs-config-init-1/share/emacs/site-lisp/early-init.elc
├── eln-cache
│   └── 31.0.50-0186c17f
│       ├── early-init-ca07bdae-ee82ea37.eln -> /nix/store/qq073crkwrjvpfrfnsbsqq502c8k0a5y-emacs-config-init-1/share/emacs/native-lisp/31.0.50-0186c17f/early-init-ca07bdae-ee82ea37.eln
│       └── init-ab609663-d324ef3d.eln -> /nix/store/qq073crkwrjvpfrfnsbsqq502c8k0a5y-emacs-config-init-1/share/emacs/native-lisp/31.0.50-0186c17f/init-ab609663-d324ef3d.eln
├── init.el -> /nix/store/qq073crkwrjvpfrfnsbsqq502c8k0a5y-emacs-config-init-1/share/emacs/site-lisp/init.el
└── init.elc -> /nix/store/qq073crkwrjvpfrfnsbsqq502c8k0a5y-emacs-config-init-1/share/emacs/site-lisp/init.elc

However, when I remove any mutable eln-cache directory I get the following message:

"Error muted by safe_call: (apply native--compile-async ("/nix/store/ln4pwf5blaqiynydrcn344zn7kbfn6vs-emacs-config/early-init.el" nil late)) signaled (error "Cannot find suitable directory for output in ‘native-comp-eln-load-path’.")"

Or, when I do give it a mutable eln-cache directory, it ends up recompiling it in the background doing unnecessary work:

/home/jd/.local/state/emacs/eln-cache/31.0.50-0186c17f/
└── early-init-ed4380c6-4ba9e9ac.eln

When I set add  `/nix/store/ln4pwf5blaqiynydrcn344zn7kbfn6vs-emacs-config/eln-cache` to `EMACSNATIVELOADPATH` everything works great. But ideally, startup.el should respect `--init-directory` and update the eln-cache location for you
before loading early-init.el





  reply	other threads:[~2024-12-22 13:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-22 11:57 bug#75022: 31.0.50; --init-directory sets user-emacs-directory after user eln-cache is set Jordan Isaacs
2024-12-22 12:44 ` Eli Zaretskii
2024-12-22 13:12   ` Jordan Isaacs [this message]
2024-12-22 16:26     ` Eli Zaretskii
2024-12-22 21:26       ` Jordan Isaacs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29d07feb-4886-4edd-b4ea-1f1cd5f63549@app.fastmail.com \
    --to=jordan@snowytrees.dev \
    --cc=75022@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.