all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Manuel Uberti <manuel.uberti@inventati.org>
Cc: Andrea Corallo <akrl@sdf.org>, 53596@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <87lez0gdov.fsf@gnus.org> (raw)
In-Reply-To: <5045943a-9d77-c7f9-b0cf-6c8feb68d39d@inventati.org> (Manuel Uberti's message of "Fri, 28 Jan 2022 14:49:51 +0100")

Manuel Uberti <manuel.uberti@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





  parent reply	other threads:[~2022-01-28 14:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28  6:42 bug#53596: 29.0.50; comp-trampoline-compile: Cannot find suitable directory for output in `native-comp-eln-load-path' Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28  9:50 ` Andrea Corallo
2022-01-28  9:52   ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28  9:57     ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28 10:06     ` Andrea Corallo
2022-01-28 10:09       ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28 10:10         ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28 10:22           ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28 10:32             ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28 13:00               ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28 13:33                 ` Andrea Corallo
2022-01-28 13:49                   ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28 13:55                     ` Andrea Corallo
2022-01-28 14:03                     ` Lars Ingebrigtsen [this message]
2022-01-28 14:18                       ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28 14:27                         ` Lars Ingebrigtsen
2022-01-28 16:53                           ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28 19:07                           ` Michael Heerdegen
2022-01-29  7:41                             ` Andrea Corallo
2022-01-29 17:36                               ` Michael Heerdegen
2022-01-29 17:55                                 ` Eli Zaretskii
2022-01-30  1:26                                   ` Michael Heerdegen
2022-01-30  6:45                                     ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=87lez0gdov.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=53596@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=manuel.uberti@inventati.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.