diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-02-23 14:06:59 +0000 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-02-23 16:50:15 +0000 |
commit | 1dc237f280702d959216916b236cb9bf9bbcb22c (patch) | |
tree | d682b8a0e28c30b8e8f1437e1ce0db1f97178ac7 /lisp/emacs-lisp/comp.el | |
parent | 5153dc17f2393d8fd89d2331b0e9f7ba2d925e87 (diff) | |
download | emacs-1dc237f280702d959216916b236cb9bf9bbcb22c.tar.gz emacs-1dc237f280702d959216916b236cb9bf9bbcb22c.tar.bz2 emacs-1dc237f280702d959216916b236cb9bf9bbcb22c.zip |
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.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r-- | lisp/emacs-lisp/comp.el | 16 |
1 files changed, 10 insertions, 6 deletions
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) |