mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 02:31:03 -08:00
* Fix error reporting for async native compilation (bug#47024)
* lisp/emacs-lisp/comp.el (comp--native-compile): During async compilation if we catch an error print it in a parsable way so we can report it to the user.
This commit is contained in:
parent
711b2c8349
commit
0144764d1d
1 changed files with 17 additions and 5 deletions
|
|
@ -3970,12 +3970,24 @@ load once it finishes compiling."
|
||||||
(comp-log (format "Done compiling %s" data) 0)
|
(comp-log (format "Done compiling %s" data) 0)
|
||||||
(cl-loop for (pass . time) in (reverse report)
|
(cl-loop for (pass . time) in (reverse report)
|
||||||
do (comp-log (format "Pass %s took: %fs." pass time) 0))))
|
do (comp-log (format "Pass %s took: %fs." pass time) 0))))
|
||||||
(native-compiler-error
|
(t
|
||||||
;; Add source input.
|
|
||||||
(let ((err-val (cdr err)))
|
(let ((err-val (cdr err)))
|
||||||
(signal (car err) (if (consp err-val)
|
;; If we are doing an async native compilation print the
|
||||||
(cons function-or-file err-val)
|
;; error in the correct format so is parsable and abort.
|
||||||
(list function-or-file err-val))))))
|
(if (and comp-async-compilation
|
||||||
|
(not (eq (car err) 'native-compiler-error)))
|
||||||
|
(progn
|
||||||
|
(message (if err-val
|
||||||
|
"%s: Error: %s %s"
|
||||||
|
"%s: Error %s")
|
||||||
|
function-or-file
|
||||||
|
(get (car err) 'error-message)
|
||||||
|
(car-safe err-val))
|
||||||
|
(kill-emacs -1))
|
||||||
|
;; Otherwise re-signal it adding the compilation input.
|
||||||
|
(signal (car err) (if (consp err-val)
|
||||||
|
(cons function-or-file err-val)
|
||||||
|
(list function-or-file err-val)))))))
|
||||||
(if (stringp function-or-file)
|
(if (stringp function-or-file)
|
||||||
data
|
data
|
||||||
;; So we return the compiled function.
|
;; So we return the compiled function.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue