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

From: Sun Lin <[email-masked]>
Date: Tue, 30 Nov 2021 16:21:06 +0000 (UTC)

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