unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Tom Gillespie <tgbugs@gmail.com>
Cc: 43476@debbugs.gnu.org, akrl@sdf.org
Subject: bug#43476: feature/native-comp; path for .eln files when running with --no-init-file
Date: Sat, 10 Oct 2020 09:48:09 +0000	[thread overview]
Message-ID: <xjfwnzypg2u.fsf@sdf.org> (raw)
In-Reply-To: <CA+G3_PNAvJ3rNxBk-efewVxoXf43DZB6juX8TVoRFdLGKjKBwQ@mail.gmail.com>

Tom Gillespie <tgbugs@gmail.com> writes:

> Hi Andrea,
>    Not quite a bug, but an inconsistency in the behavior of
> comp-eln-load-path compared to the behavior of load-path. Best!
> Tom
>
> While investigating the json-mode kill-buffer bug I encountered an
> issue which seems like it might cause confusion at some point.
> comp-eln-load-path is set at startup and materialized.
>
> When Emacs is launched with -q, load-path does not contain the
> materialized locations of paths inside user-emacs-directory until
> after a call to package-initialize.
>
> I think that there is a similar need for comp-eln-load-path, which is
> that it needs to exclude the user eln cache path when emacs is
> launched with -q so that it is possible to debug issues arising from
> stale/bad eln files. There will be a similar issue with site-lisp and
> -Q.
>
> I don't know whether stale files could cause a problem given how you
> hash to generate the names for the eln files, but I'm imagining cases
> where someone upgraded gcc or libgccjit and something changed. I think
> that not setting the user path when Emacs is run with -q is consistent
> with Emacs behavior for load-path.
>
> Right now a user has to explicitly pop the old eln cache directory and
> then update the new directory if they reset user-emacs-directory as I
> do in the longer reproduction for the json-mode bug (reproduced
> below).
>
> #+begin_src bash
> emacs -q \
> --eval "(setq user-emacs-directory \"/tmp/test/.emacs.d/\")" \
> --eval "(when (boundp 'comp-eln-load-path) (pop comp-eln-load-path)
> (add-to-list 'comp-eln-load-path (concat user-emacs-directory \"eln-cache\")))"
> #+end_src
>
> I don't have a good solution for this, but wanted to raise the issue
> since I anticipate that there will be quite a bit of confusion if the
> user eln cache continues to point to the path ~/.emacs.d/eln-cache
> instead of either not being set or updating to be inside
> user-emacs-directory the first time the value is needed.

Hi Tom,

I think the fundamental issue is that we need a eln-cache directory to
operate anyway.  So either we assume that eln compilation is correct and
transparent (current approach) or we need to set the eln-cache directory
to be in some temporary directory for every -q run.  This would indeed
require the recompilation a bunch of compilation units at each -q
startup.

I'm personally for keeping the current approach as the second one could
be annoying especially on non very powerful machines.  Still a power
user (like you :) can decide not to trust the correctness assumption and
hack it around as you have showed.

As ATM I don't have any better idea on this I'd be for closing this bug
unless some idea/action is suggested, what do you think about?

Thanks

  Andrea





  reply	other threads:[~2020-10-10  9:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 18:03 bug#43476: feature/native-comp; path for .eln files when running with --no-init-file Tom Gillespie
2020-10-10  9:48 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2020-10-10 19:12   ` Tom Gillespie
2020-10-10 19:22     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=xjfwnzypg2u.fsf@sdf.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=43476@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=tgbugs@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).