From 1dc237f280702d959216916b236cb9bf9bbcb22c Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 23 Feb 2020 14:06:59 +0000 Subject: Make build process robust against interruptions During boo-strap we produce both the .eln and the .elc together. Because the make target is the later this has to be produced as last to be resilient to build interruptions. --- lisp/emacs-lisp/comp.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lisp/emacs-lisp/comp.el') diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index edbc98f190b..c13844c70b7 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2071,12 +2071,16 @@ Return the compilation unit file name." (defun batch-byte-native-compile-for-bootstrap () "As `batch-byte-compile' but used for booststrap. Always generate elc files too and handle native compiler expected errors." - ;; FIXME remove when dynamic scope support is implemented. - (let ((byte-native-always-write-elc t)) - (condition-case _ - (batch-native-compile) - (native-compiler-error-dyn-func) - (native-compiler-error-empty-byte)))) + (let ((byte-native-for-bootstrap t) + (byte-to-native-output-file nil)) + (unwind-protect + (condition-case _ + (batch-native-compile) + (native-compiler-error-dyn-func) + (native-compiler-error-empty-byte)) + (pcase byte-to-native-output-file + (`(,tempfile . ,target-file) + (rename-file tempfile target-file t)))))) ;;;###autoload (defun native-compile-async (input &optional jobs recursively) -- cgit v1.2.3