]> git.eshelyaron.com Git - emacs.git/commitdiff
propagate load-path into async workers + better messaging
authorAndrea Corallo <akrl@sdf.org>
Tue, 12 Nov 2019 18:55:57 +0000 (19:55 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:04 +0000 (11:38 +0100)
lisp/emacs-lisp/comp.el

index eab8ffc21667bb015c53df8647e1497c8486eab2..1acb97d1e0ad9b8ddd644c9da2782a4639398f68 100644 (file)
@@ -1779,18 +1779,23 @@ Prepare every function for final compilation and drive the C back-end."
        (while (setf f (with-mutex comp-src-pool-mutex
                         (pop comp-src-pool)))
          (when (comp-to-file-p f)
-           (let* ((code `(let ((comp-speed ,comp-speed)
-                               (comp-debug ,comp-debug)
-                               (comp-verbose ,comp-verbose))
+           (let* ((code `(progn
+                           (require 'comp)
+                           (setq comp-speed ,comp-speed)
+                           (setq comp-debug ,comp-debug)
+                           (setq comp-verbose ,comp-verbose)
+                           (setq load-path ',load-path)
+                           (message "Compiling %s started." ,f)
                            (native-compile ,f)))
-                  (cmd (concat invocation-directory invocation-name
-                               " --batch --eval='"
-                               (prin1-to-string code) "'"))
-                  (prc (start-process-shell-command (concat "async compilation: " f)
-                                                    "async-compile-buffer"
-                                                    cmd)))
+                  (prc (start-process (concat "Compiling: " f)
+                                      "async-compile-buffer"
+                                      (concat invocation-directory invocation-name)
+                                      "--batch"
+                                      "--eval"
+                                      (prin1-to-string code))))
              (while (accept-process-output prc)
-               (thread-yield)))))))))
+               (thread-yield)))))))
+   "compilation thread"))
 \f
 ;;; Compiler entry points.