[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 1ec7499 2/3: * Add a warning for missing write privi
From: |
Andrea Corallo |
Subject: |
feature/native-comp 1ec7499 2/3: * Add a warning for missing write privilege |
Date: |
Mon, 4 May 2020 14:01:01 -0400 (EDT) |
branch: feature/native-comp
commit 1ec7499e59a8724cb9f3d8688a7c922acad3be27
Author: Andrea Corallo <address@hidden>
Commit: Andrea Corallo <address@hidden>
* Add a warning for missing write privilege
* lisp/emacs-lisp/comp.el (native-compile-async): Check for write
privilege and raise a warning in case.
---
lisp/emacs-lisp/comp.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index f027bad..bd4c25a 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -2344,7 +2344,16 @@ queued with LOAD %"
file load (cdr entry))
;; Make sure we are not already compiling `file' (bug#40838).
(unless (gethash file comp-async-compilations)
- (setf comp-files-queue (append comp-files-queue `((,file .
,load)))))))
+ (let ((out-dir (comp-output-directory file))
+ (out-filename (comp-output-filename file)))
+ (if (or (file-writable-p out-filename)
+ (and (not (file-exists-p out-dir))
+ (file-writable-p (substring out-dir 0 -1))))
+ (setf comp-files-queue
+ (append comp-files-queue `((,file . ,load))))
+ (display-warning 'comp
+ (format "No write access for %s skipping."
+ out-filename)))))))
(when (zerop (comp-async-runnings))
(comp-run-async-workers)
(message "Compilation started."))))