]> git.eshelyaron.com Git - emacs.git/commitdiff
* Remove a false permission related error while native compiling
authorAndrea Corallo <akrl@sdf.org>
Sun, 16 Aug 2020 14:40:03 +0000 (16:40 +0200)
committerAndrea Corallo <akrl@sdf.org>
Mon, 17 Aug 2020 16:04:23 +0000 (18:04 +0200)
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Do not crash if
native compiling we have no permission to create the .elc
file.  We are not creating it.

lisp/emacs-lisp/bytecomp.el

index 20a481a8a1c65b5cbf640d08cba02c8f8a994ecc..507cfe76ffab19ccf2f4a34808438854f8ac3ecb 100644 (file)
@@ -2041,7 +2041,8 @@ The value is non-nil if there were no errors, nil if errors."
        (with-current-buffer output-buffer
          (goto-char (point-max))
          (insert "\n")                 ; aaah, unix.
-         (if (file-writable-p target-file)
+         (if (or (file-writable-p target-file)
+                  byte-native-compiling)
              ;; We must disable any code conversion here.
              (progn
                (let* ((coding-system-for-write 'no-conversion)
@@ -2050,7 +2051,8 @@ The value is non-nil if there were no errors, nil if errors."
                       ;; parallel bootstrap), it does not risk getting a
                       ;; half-finished file.  (Bug#4196)
                       (tempfile
-                       (make-temp-file (expand-file-name target-file)))
+                       (make-temp-file (when (file-writable-p target-file)
+                                          (expand-file-name target-file))))
                       (default-modes (default-file-modes))
                       (temp-modes (logand default-modes #o600))
                       (desired-modes (logand default-modes #o666))