@@ -911,7 +911,17 @@ (define build
(format (current-error-port)
"Generating package cache for '~a'...~%"
#$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)
+ ;; Guile 1 prints the whole backtrace, and would need a
+ ;; fluid set for the backtrace procedure to work, so ignore.
+ (unless (string-prefix? "1" (version))
+ (backtrace)))))
(mkdir #$output))))
(gexp->derivation-in-inferior "guix-package-cache" build