From 4320307843b44fa049ba7e8217f0349932ff56e5 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Tue, 12 Nov 2019 19:55:57 +0100 Subject: [PATCH] propagate load-path into async workers + better messaging --- lisp/emacs-lisp/comp.el | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index eab8ffc2166..1acb97d1e0a 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -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")) ;;; Compiler entry points. -- 2.39.5