]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bytecomp container test case
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 11 Aug 2021 23:19:26 +0000 (01:19 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 11 Aug 2021 23:19:30 +0000 (01:19 +0200)
* lisp/startup.el (normal-top-level): Make startup more robust --
we may not be allowed to create any directories when running under
test mode (bug#48350).

lisp/startup.el

index f337f7c6bcfe0d68620a2bc9ee70ea249b740c18..58030ca06af8e0d85300c6b87272c4c020bef8a4 100644 (file)
@@ -549,7 +549,11 @@ It is the default value of the variable `top-level'."
       ;; When $HOME is set to '/nonexistent' means we are running the
       ;; testsuite, add a temporary folder in front to produce there
       ;; new compilations.
-      (when (equal (getenv "HOME") "/nonexistent")
+      (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))))