aboutsummaryrefslogtreecommitdiff
path: root/guix/status.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-02-06 15:02:34 +0100
committerLudovic Courtès <ludo@gnu.org>2023-02-11 00:09:40 +0100
commit3ab8559436356ef89aa60135d3558681d64443ae (patch)
tree3ec0c267a772cb4749fcb3d68a627fdb7c928d03 /guix/status.scm
parentf944fa718dbfbfafecf30a71d9d4c31dc861996b (diff)
downloadguix-3ab8559436356ef89aa60135d3558681d64443ae.tar
guix-3ab8559436356ef89aa60135d3558681d64443ae.tar.gz
status: Print a hint when a 'package-cache' hook fails to build.
* guix/channels.scm (package-cache-file): Add 'channels' to the #:properties list. * guix/status.scm (print-build-event): Upon failure, display a hint when the derivation is a 'package-cache' hook.
Diffstat (limited to 'guix/status.scm')
-rw-r--r--guix/status.scm18
1 files changed, 17 insertions, 1 deletions
diff --git a/guix/status.scm b/guix/status.scm
index 2c69f49fb5..5580c80ea9 100644
--- a/guix/status.scm
+++ b/guix/status.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017-2022 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017-2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
@@ -22,6 +22,7 @@
#:use-module (guix i18n)
#:use-module (guix colors)
#:use-module (guix progress)
+ #:autoload (guix ui) (display-hint)
#:autoload (guix build syscalls) (terminal-columns)
#:autoload (guix build download) (nar-uri-abbreviation)
#:use-module (guix store)
@@ -526,6 +527,21 @@ substitutes being downloaded."
(erase-current-line*) ;erase spinner or progress bar
(format port (failure (G_ "build of ~a failed")) drv)
(newline port)
+ (let ((properties (and=> (false-if-exception
+ (read-derivation-from-file drv))
+ derivation-properties)))
+ (when (and (pair? properties)
+ (eq? (assq-ref properties 'type) 'profile-hook)
+ (eq? (assq-ref properties 'hook) 'package-cache))
+ (display-hint (format #f (G_ "This usually indicates a bug in one of
+the channels you are pulling from, or some incompatibility among them. You
+can check the build log and report the issue to the channel developers.
+
+The channels you are pulling from are: ~a.")
+ (string-join
+ (map symbol->string
+ (or (assq-ref properties 'channels)
+ '(guix))))))))
(match (derivation-log-file drv)
(#f
(format port (failure (G_ "Could not find build log for '~a'."))