From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: References: Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21564"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43476@debbugs.gnu.org, akrl@sdf.org To: Tom Gillespie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 10 11:49:17 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kRBV7-0005WB-2Y for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Oct 2020 11:49:17 +0200 Original-Received: from localhost ([::1]:39670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRBV5-0006mJ-NA for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Oct 2020 05:49:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRBUr-0006m5-T9 for bug-gnu-emacs@gnu.org; Sat, 10 Oct 2020 05:49:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53681) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRBUr-00023m-KM for bug-gnu-emacs@gnu.org; Sat, 10 Oct 2020 05:49:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kRBUr-0004uy-Ie for bug-gnu-emacs@gnu.org; Sat, 10 Oct 2020 05:49:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Oct 2020 09:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43476 X-GNU-PR-Package: emacs Original-Received: via spool by 43476-submit@debbugs.gnu.org id=B43476.160232329718851 (code B ref 43476); Sat, 10 Oct 2020 09:49:01 +0000 Original-Received: (at 43476) by debbugs.gnu.org; 10 Oct 2020 09:48:17 +0000 Original-Received: from localhost ([127.0.0.1]:36994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kRBU8-0004tz-MV for submit@debbugs.gnu.org; Sat, 10 Oct 2020 05:48:16 -0400 Original-Received: from mab.sdf.org ([205.166.94.33]:41684 helo=ma.sdf.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kRBU2-0004tn-R2 for 43476@debbugs.gnu.org; Sat, 10 Oct 2020 05:48:15 -0400 Original-Received: from akrl by ma.sdf.org with local (Exim 4.92) (envelope-from ) id 1kRBU1-0007QG-EQ; Sat, 10 Oct 2020 09:48:09 +0000 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190205 Archived-At: Tom Gillespie 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