emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57562: closed ([PATCH] * lisp/emacs-lisp/comp.el (comp-run-async-wor


From: GNU bug Tracking System
Subject: bug#57562: closed ([PATCH] * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail more gracefully)
Date: Sat, 03 Sep 2022 19:18:02 +0000

Your message dated Sat, 03 Sep 2022 15:17:08 -0400
with message-id <jwv4jxoxo7u.fsf-monnier+emacs@gnu.org>
and subject line Re: bug#57562: [PATCH] * lisp/emacs-lisp/comp.el 
(comp-run-async-workers): Fail more gracefully
has caused the debbugs.gnu.org bug report #57562,
regarding [PATCH] * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail more 
gracefully
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
57562: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57562
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail more gracefully Date: Sat, 03 Sep 2022 11:00:09 -0400
Tags: patch

Any objection to installing this patch into `emacs-28`?


        Stefan


 In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw3d scroll bars) of 2022-08-29 built on pastel
Repository revision: b4cabfe2b1be20c2d896da81a8e408b57612905b
Repository branch: work
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure -C --enable-checking --enable-check-lisp-object-type --with-modules 
--with-cairo --with-tiff=ifavailable
 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign'
 PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig'

>From d0a989debc23ddeb692c120fb4aa5b8568e3c754 Mon Sep 17 00:00:00 2001
From: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Sat, 3 Sep 2022 10:51:17 -0400
Subject: [PATCH] * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail more
 gracefully

Otherwise Emacs may fail to start if it can't find a writable
`~/.emacs.d/eln-cache` directory.
See Debian's bug #1017739.
---
 lisp/emacs-lisp/comp.el | 32 +++++++++++++++++++-------------
 1 file changed, 19 insertions(+), 13 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 306ec918b1a..6e2564236db 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -1370,19 +1370,22 @@ comp-spill-lap-function
   (unless byte-to-native-top-level-forms
     (signal 'native-compiler-error-empty-byte filename))
   (unless (comp-ctxt-output comp-ctxt)
-    (setf (comp-ctxt-output comp-ctxt) (comp-el-to-eln-filename
-                                        filename
-                                        (or native-compile-target-directory
-                                            (when byte+native-compile
-                                              (car (last 
native-comp-eln-load-path)))))))
+    (setf (comp-ctxt-output comp-ctxt)
+          (comp-el-to-eln-filename
+           filename
+           (or native-compile-target-directory
+               (when byte+native-compile
+                 (car (last native-comp-eln-load-path)))))))
   (setf (comp-ctxt-speed comp-ctxt) (alist-get 'native-comp-speed
                                                byte-native-qualities)
         (comp-ctxt-debug comp-ctxt) (alist-get 'native-comp-debug
                                                byte-native-qualities)
-        (comp-ctxt-compiler-options comp-ctxt) (alist-get 
'native-comp-compiler-options
-                                                        byte-native-qualities)
-        (comp-ctxt-driver-options comp-ctxt) (alist-get 
'native-comp-driver-options
-                                                        byte-native-qualities)
+        (comp-ctxt-compiler-options comp-ctxt)
+        (alist-get 'native-comp-compiler-options
+                   byte-native-qualities)
+        (comp-ctxt-driver-options comp-ctxt)
+        (alist-get 'native-comp-driver-options
+                   byte-native-qualities)
         (comp-ctxt-top-level-forms comp-ctxt)
         (cl-loop
          for form in (reverse byte-to-native-top-level-forms)
@@ -3933,10 +3936,13 @@ comp-run-async-workers
                        "`comp-files-queue' should be \".el\" files: %s"
                        source-file)
          when (or native-comp-always-compile
-                  load ; Always compile when the compilation is
-                       ; commanded for late load.
-                  (file-newer-than-file-p
-                   source-file (comp-el-to-eln-filename source-file)))
+                  load        ; Always compile when the compilation is
+                              ; commanded for late load.
+                  ;; Skip compilation if `comp-el-to-eln-filename' fails
+                  ;; to find a writable directory.
+                  (with-demoted-errors "Async compilation :%S"
+                    (file-newer-than-file-p
+                     source-file (comp-el-to-eln-filename source-file))))
          do (let* ((expr `((require 'comp)
                            (setq comp-async-compilation t)
                            (setq warning-fill-column most-positive-fixnum)
-- 
2.30.2


--- End Message ---
--- Begin Message --- Subject: Re: bug#57562: [PATCH] * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail more gracefully Date: Sat, 03 Sep 2022 15:17:08 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
> Here is the cleaner `emacs-28` version.

Pushed,


        Stefan



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]