channels: Print backtrace when generating package cache fails.
* guix/channels.scm (package-cache-file): Add a throw handler around the generate-package-cache call, and print backtrace in it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
c48c69cfa3
commit
f404112007
1 changed files with 8 additions and 1 deletions
|
|
@ -907,7 +907,14 @@ be used as a profile hook."
|
||||||
(format (current-error-port)
|
(format (current-error-port)
|
||||||
"Generating package cache for '~a'...~%"
|
"Generating package cache for '~a'...~%"
|
||||||
#$profile)
|
#$profile)
|
||||||
(generate-package-cache #$output))
|
;; This script runs through (primitive-load), which by default
|
||||||
|
;; doesn't print backtraces when it encounters an exception,
|
||||||
|
;; so manually do it. Use with-throw-handler because it is
|
||||||
|
;; supported by all Guile versions.
|
||||||
|
(with-throw-handler #t
|
||||||
|
(lambda () (generate-package-cache #$output))
|
||||||
|
(lambda (key . args)
|
||||||
|
(backtrace))))
|
||||||
(mkdir #$output))))
|
(mkdir #$output))))
|
||||||
|
|
||||||
(gexp->derivation-in-inferior "guix-package-cache" build
|
(gexp->derivation-in-inferior "guix-package-cache" build
|
||||||
|
|
|
||||||
Reference in a new issue