diff options
author | Ludovic Courtès <ludo@gnu.org> | 2023-06-05 23:41:37 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2023-06-14 22:54:30 +0200 |
commit | e4259d4e9e3251e4c4b45d1cce4008ac32b504c8 (patch) | |
tree | 7baa5cee009351303353cdd2b4b4183fa2501259 /guix/ui.scm | |
parent | 35c27ec5eedfe8ea4fc653bef0bf213c1a58e7a2 (diff) |
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.scm | 9 |
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)) |