mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
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.
This commit is contained in:
parent
35c27ec5ee
commit
e4259d4e9e
3 changed files with 56 additions and 11 deletions
|
@ -368,6 +368,23 @@
|
|||
(package-transitive-supported-systems d)
|
||||
(package-transitive-supported-systems e))))
|
||||
|
||||
(test-equal "package-transitive-supported-systems detects cycles"
|
||||
'("c" "a" "b" "c")
|
||||
(letrec* ((a (dummy-package "a"
|
||||
(build-system trivial-build-system)
|
||||
(native-inputs (list c))))
|
||||
(b (dummy-package "b"
|
||||
(build-system trivial-build-system)
|
||||
(inputs (list a))))
|
||||
(c (dummy-package "c"
|
||||
(build-system trivial-build-system)
|
||||
(inputs (list b)))))
|
||||
(guard (c ((package-cyclic-dependency-error? c)
|
||||
(map package-name
|
||||
(cons (package-error-package c)
|
||||
(package-error-dependency-cycle c)))))
|
||||
(package-transitive-supported-systems c))))
|
||||
|
||||
(test-assert "package-development-inputs"
|
||||
;; Note: Due to propagated inputs, 'package-development-inputs' returns a
|
||||
;; couple more inputs, such as 'linux-libre-headers'.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue