aboutsummaryrefslogtreecommitdiff
path: root/guix/ui.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-06-05 23:41:37 +0200
committerLudovic Courtès <ludo@gnu.org>2023-06-14 22:54:30 +0200
commite4259d4e9e3251e4c4b45d1cce4008ac32b504c8 (patch)
tree7baa5cee009351303353cdd2b4b4183fa2501259 /guix/ui.scm
parent35c27ec5eedfe8ea4fc653bef0bf213c1a58e7a2 (diff)
downloadguix-e4259d4e9e3251e4c4b45d1cce4008ac32b504c8.tar
guix-e4259d4e9e3251e4c4b45d1cce4008ac32b504c8.tar.gz
packages: 'package-transitive-supported-systems' detects cycles.
With this change, commands such as 'guix build' or 'guix package' report obvious package-level cycles upfront. Derivation-level cycles are not detected. * guix/packages.scm (&package-cyclic-dependency-error): New condition type. (package-transitive-supported-systems): Define 'visited', check it, and parameterize it. * guix/ui.scm (call-with-error-handling): Handle '&package-cyclic-dependency-error'. * tests/packages.scm ("package-transitive-supported-systems detects cycles"): Add test.
Diffstat (limited to 'guix/ui.scm')
-rw-r--r--guix/ui.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 7540e2194f..47a118364a 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -722,6 +722,15 @@ evaluating the tests and bodies of CLAUSES."
(leave (G_ "~a:~a:~a: package `~a' has an invalid input: ~s~%")
file line column
(package-full-name package) input)))
+ ((package-cyclic-dependency-error? c)
+ (let ((package (package-error-package c)))
+ (leave (package-location package)
+ (G_ "~a: dependency cycle detected:
+ ~a~{ -> ~a~}~%")
+ (package-full-name package)
+ (package-full-name package)
+ (map package-full-name
+ (package-error-dependency-cycle c)))))
((package-cross-build-system-error? c)
(let* ((package (package-error-package c))
(loc (package-location package))