Subject: bug#52199: closed (Re: bug#52199: [PATH] 28.0.60; custom native-comp eln cache with EMACSNATIVELOADPATH)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 15 Dec 2021 21:10:02 +0000

Your bug report

#52199: [PATH] 28.0.60; custom native-comp eln cache with EMACSNATIVELOADPATH

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
52199: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=52199
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#52199: [PATH] 28.0.60; custom native-comp eln cache with EMACSNATIVELOADPATH
From: Stefan Kangas <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked], Andrea Corallo <[email-masked]>
Date: Wed, 15 Dec 2021 13:09:16 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Eli Zaretskii <[email-masked]> writes:

>> From: Andrea Corallo <[email-masked]>
>> Date: Tue, 30 Nov 2021 16:31:55 +0000
>> Cc: Sun Lin <[email-masked]>
>>
>> > It seems native-comp-async always store the *.eln files in to the ~/.emacs.d/eln-cache/.
>>
>> More preciselly under: (expand-file-name "eln-cache/" user-emacs-directory)
>>
>> > We can switch the EMACSNATIVELOADPATH values to the head of native-comp-eln-load-path,
>> > then the *.eln will be stored in EMACSNATIVELOADPATH.
>>
>> Could you elaborate why would you want to do this?
>
> Yes, please.  because I'm not sure we want to support that.  In
> general, EMACSNATIVELOADPATH is for "system" *.eln files, and only the
> eln-cache directory is where the user-compiled *.eln files should
> live.

More information was requested, but none was given within 2 weeks, so
I'm closing this bug.  If this is still an issue, please reply to this
email (use "Reply to all" in your email client) and we can reopen the
bug report.

Subject: [PATH] 28.0.60; custom native-comp eln cache with EMACSNATIVELOADPATH
From: Sun Lin <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Tue, 30 Nov 2021 16:21:06 +0000 (UTC)
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

It seems native-comp-async always store the *.eln files in to the ~/.emacs.d/eln-cache/.

We can switch the EMACSNATIVELOADPATH values to the head of native-comp-eln-load-path,
then the *.eln will be stored in EMACSNATIVELOADPATH.

This patch try to enable custom the eln cache directory.

$ export EMACSNATIVELOADPATH=/tmp/eln-cache
$ emacs 

B.R.
Lin

From 13a71a3eed3412e78297f8f9deb34a40bb355c95 Mon Sep 17 00:00:00 2001
From: Lin Sun <[email-masked]>
Date: Tue, 30 Nov 2021 16:01:18 +0000
Subject: [PATCH] * lisp/startup.el (normal-top-level):

Custom native-comp eln cache with EMACSNATIVELOADPATH.
---
 lisp/startup.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/startup.el b/lisp/startup.el
index 505d7b8..999bab0 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -539,13 +539,13 @@ normal-top-level
 
     (when (featurep 'native-compile)
       ;; Form `native-comp-eln-load-path'.
+      (push (expand-file-name "eln-cache/" user-emacs-directory)
+            native-comp-eln-load-path)
       (let ((path-env (getenv "EMACSNATIVELOADPATH")))
         (when path-env
           (dolist (path (split-string path-env path-separator))
             (unless (string= "" path)
               (push path native-comp-eln-load-path)))))
-      (push (expand-file-name "eln-cache/" user-emacs-directory)
-            native-comp-eln-load-path)
       ;; When $HOME is set to '/nonexistent' means we are running the
       ;; testsuite, add a temporary folder in front to produce there
       ;; new compilations.
-- 
2.7.0