GNU bug report logs - #53596
29.0.50; comp-trampoline-compile: Cannot find suitable directory for output in `native-comp-eln-load-path'

Previous Next

Package: emacs;

Reported by: Manuel Uberti <manuel.uberti <at> inventati.org>

Date: Fri, 28 Jan 2022 06:43:01 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #44 received at 53596 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Manuel Uberti <manuel.uberti <at> inventati.org>
Cc: 53596 <at> debbugs.gnu.org, Andrea Corallo <akrl <at> sdf.org>
Subject: Re: bug#53596: 29.0.50; comp-trampoline-compile: Cannot find
 suitable directory for output in `native-comp-eln-load-path'
Date: Fri, 28 Jan 2022 15:03:28 +0100
Manuel Uberti <manuel.uberti <at> inventati.org> writes:

> It works as expected without those changes.

Could you see whether the following patch fixes the problem?

diff --git a/lisp/startup.el b/lisp/startup.el
index 60aaa76002..66dd726ae9 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -693,6 +693,47 @@ normal-top-level
     (let ((old-face-font-rescale-alist face-font-rescale-alist))
       (unwind-protect
 	  (command-line)
+
+        ;; Do this after `command-line', since it may alter
+        ;; `user-emacs-directory'.
+        (when (featurep 'native-compile)
+          ;; Form `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.
+          (when (and (equal (getenv "HOME") "/nonexistent")
+                     ;; We may be running in a chroot environment where we
+                     ;; can't write anything.
+                     (file-writable-p (expand-file-name
+                                       (or temporary-file-directory ""))))
+            (let ((tmp-dir (make-temp-file "emacs-testsuite-" t)))
+              (add-hook 'kill-emacs-hook
+                        (lambda ()
+                          (delete-directory tmp-dir t)))
+              (push tmp-dir native-comp-eln-load-path)))
+          (when locale-coding-system
+            (let ((coding (if (eq system-type 'windows-nt)
+			      ;; MS-Windows build converts all file names to
+			      ;; UTF-8 during startup.
+			      'utf-8
+		            locale-coding-system))
+                  (npath (symbol-value 'native-comp-eln-load-path)))
+              (set 'native-comp-eln-load-path
+                   (mapcar (lambda (dir)
+                             ;; Call expand-file-name to remove all the
+                             ;; pesky ".." from the directyory names in
+                             ;; native-comp-eln-load-path.
+                             (expand-file-name
+                              (decode-coding-string dir coding t)))
+                           npath)))))
+
 	;; Do this again, in case .emacs defined more abbreviations.
 	(if default-directory
 	    (setq default-directory (abbreviate-file-name default-directory)))
@@ -760,44 +801,6 @@ normal-top-level
 	(unless inhibit-startup-hooks
 	  (run-hooks 'window-setup-hook))))
 
-    ;; Do this after `command-line', since it may alter
-    ;; `user-emacs-directory'.
-    (when (featurep 'native-compile)
-      ;; Form `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.
-      (when (and (equal (getenv "HOME") "/nonexistent")
-                 ;; We may be running in a chroot environment where we
-                 ;; can't write anything.
-                 (file-writable-p (expand-file-name
-                                   (or temporary-file-directory ""))))
-        (let ((tmp-dir (make-temp-file "emacs-testsuite-" t)))
-          (add-hook 'kill-emacs-hook (lambda () (delete-directory tmp-dir t)))
-          (push tmp-dir native-comp-eln-load-path)))
-      (when locale-coding-system
-        (let ((coding (if (eq system-type 'windows-nt)
-			  ;; MS-Windows build converts all file names to
-			  ;; UTF-8 during startup.
-			  'utf-8
-		        locale-coding-system))
-              (npath (symbol-value 'native-comp-eln-load-path)))
-          (set 'native-comp-eln-load-path
-               (mapcar (lambda (dir)
-                         ;; Call expand-file-name to remove all the
-                         ;; pesky ".." from the directyory names in
-                         ;; native-comp-eln-load-path.
-                         (expand-file-name
-                          (decode-coding-string dir coding t)))
-                       npath)))))
-
     ;; Subprocesses of Emacs do not have direct access to the terminal, so
     ;; unless told otherwise they should only assume a dumb terminal.
     ;; We are careful to do it late (after term-setup-hook), although the


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 169 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.