summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-08-12 01:19:26 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-08-12 01:19:30 +0200
commit8dd6120594569a1d8186211963094f53caa7a6ed (patch)
tree8afd202a88bd64d1f0ee57f24074ef977a572efd /lisp
parentbd6c3a014a55176c56ca38c89c6ecab69a384ab7 (diff)
downloademacs-8dd6120594569a1d8186211963094f53caa7a6ed.tar.gz
emacs-8dd6120594569a1d8186211963094f53caa7a6ed.tar.bz2
emacs-8dd6120594569a1d8186211963094f53caa7a6ed.zip
Fix bytecomp container test case
* 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).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/startup.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index f337f7c6bcf..58030ca06af 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -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))))