* Fix `batch-native-compile' not to spawn a subprocess
* lisp/emacs-lisp/comp.el (comp-running-batch-compilation): New var. (comp-final): Use it. (batch-native-compile): Bind `comp-running-batch-compilation' it.
This commit is contained in:
parent
894dfe70da
commit
e606cc6f40
1 changed files with 8 additions and 4 deletions
|
@ -3653,6 +3653,9 @@ Prepare every function for final compilation and drive the C back-end."
|
||||||
(defvar comp-async-compilation nil
|
(defvar comp-async-compilation nil
|
||||||
"Non-nil while executing an asynchronous native compilation.")
|
"Non-nil while executing an asynchronous native compilation.")
|
||||||
|
|
||||||
|
(defvar comp-running-batch-compilation nil
|
||||||
|
"Non-nil when compilation is driven by any `batch-*-compile' function.")
|
||||||
|
|
||||||
(defun comp-final (_)
|
(defun comp-final (_)
|
||||||
"Final pass driving the C back-end for code emission."
|
"Final pass driving the C back-end for code emission."
|
||||||
(maphash #'comp-compute-function-type (comp-ctxt-funcs-h comp-ctxt))
|
(maphash #'comp-compute-function-type (comp-ctxt-funcs-h comp-ctxt))
|
||||||
|
@ -3661,7 +3664,7 @@ Prepare every function for final compilation and drive the C back-end."
|
||||||
;; unless during bootstrap or async compilation (bug#45056). GCC
|
;; unless during bootstrap or async compilation (bug#45056). GCC
|
||||||
;; leaks memory but also interfere with the ability of Emacs to
|
;; leaks memory but also interfere with the ability of Emacs to
|
||||||
;; detect when a sub-process completes (TODO understand why).
|
;; detect when a sub-process completes (TODO understand why).
|
||||||
(if (or byte+native-compile comp-async-compilation)
|
(if (or comp-running-batch-compilation comp-async-compilation)
|
||||||
(comp-final1)
|
(comp-final1)
|
||||||
;; Call comp-final1 in a child process.
|
;; Call comp-final1 in a child process.
|
||||||
(let* ((output (comp-ctxt-output comp-ctxt))
|
(let* ((output (comp-ctxt-output comp-ctxt))
|
||||||
|
@ -4202,9 +4205,10 @@ as part of building the source tarball, in which case the .eln file
|
||||||
will be placed under the native-lisp/ directory (actually, in the
|
will be placed under the native-lisp/ directory (actually, in the
|
||||||
last directory in `native-comp-eln-load-path')."
|
last directory in `native-comp-eln-load-path')."
|
||||||
(comp-ensure-native-compiler)
|
(comp-ensure-native-compiler)
|
||||||
(let ((native-compile-target-directory
|
(let ((comp-running-batch-compilation t)
|
||||||
(if for-tarball
|
(native-compile-target-directory
|
||||||
(car (last native-comp-eln-load-path)))))
|
(if for-tarball
|
||||||
|
(car (last native-comp-eln-load-path)))))
|
||||||
(cl-loop for file in command-line-args-left
|
(cl-loop for file in command-line-args-left
|
||||||
if (or (null byte+native-compile)
|
if (or (null byte+native-compile)
|
||||||
(cl-notany (lambda (re) (string-match re file))
|
(cl-notany (lambda (re) (string-match re file))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue