summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-02-23 14:06:59 +0000
committerAndrea Corallo <akrl@sdf.org>2020-02-23 16:50:15 +0000
commit1dc237f280702d959216916b236cb9bf9bbcb22c (patch)
treed682b8a0e28c30b8e8f1437e1ce0db1f97178ac7 /lisp/emacs-lisp/comp.el
parent5153dc17f2393d8fd89d2331b0e9f7ba2d925e87 (diff)
downloademacs-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.el16
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)