packages: 'package-transitive-supported-systems' accounts for implicit inputs.
Reported by Federico Beffa. * guix/packages.scm (package-transitive-supported-systems): Use bag-direct-inputs + package->bag rather than package-direct-inputs. * tests/packages.scm ("package-transitive-supported-systems"): Add explicit 'build-system' field to each 'dummy-package' form. ("package-transitive-supported-systems, implicit inputs"): New test.
This commit is contained in:
parent
cceab87536
commit
9bf3ced06c
|
@ -579,7 +579,7 @@ supported by its dependencies."
|
||||||
(_
|
(_
|
||||||
systems)))
|
systems)))
|
||||||
(package-supported-systems package)
|
(package-supported-systems package)
|
||||||
(package-direct-inputs package)))
|
(bag-direct-inputs (package->bag package))))
|
||||||
|
|
||||||
(define (bag-direct-inputs bag)
|
(define (bag-direct-inputs bag)
|
||||||
"Same as 'package-direct-inputs', but applied to a bag."
|
"Same as 'package-direct-inputs', but applied to a bag."
|
||||||
|
|
|
@ -128,21 +128,44 @@
|
||||||
("y") ;c
|
("y") ;c
|
||||||
("y") ;d
|
("y") ;d
|
||||||
("y")) ;e
|
("y")) ;e
|
||||||
(let* ((a (dummy-package "a" (supported-systems '("x" "y" "z"))))
|
;; Use TRIVIAL-BUILD-SYSTEM because it doesn't add implicit inputs and thus
|
||||||
(b (dummy-package "b" (supported-systems '("x" "y"))
|
;; doesn't restrict the set of supported systems.
|
||||||
(inputs `(("a" ,a)))))
|
(let* ((a (dummy-package "a"
|
||||||
(c (dummy-package "c" (supported-systems '("y" "z"))
|
(build-system trivial-build-system)
|
||||||
(inputs `(("b" ,b)))))
|
(supported-systems '("x" "y" "z"))))
|
||||||
(d (dummy-package "d" (supported-systems '("x" "y" "z"))
|
(b (dummy-package "b"
|
||||||
(inputs `(("b" ,b) ("c" ,c)))))
|
(build-system trivial-build-system)
|
||||||
(e (dummy-package "e" (supported-systems '("x" "y" "z"))
|
(supported-systems '("x" "y"))
|
||||||
(inputs `(("d" ,d))))))
|
(inputs `(("a" ,a)))))
|
||||||
|
(c (dummy-package "c"
|
||||||
|
(build-system trivial-build-system)
|
||||||
|
(supported-systems '("y" "z"))
|
||||||
|
(inputs `(("b" ,b)))))
|
||||||
|
(d (dummy-package "d"
|
||||||
|
(build-system trivial-build-system)
|
||||||
|
(supported-systems '("x" "y" "z"))
|
||||||
|
(inputs `(("b" ,b) ("c" ,c)))))
|
||||||
|
(e (dummy-package "e"
|
||||||
|
(build-system trivial-build-system)
|
||||||
|
(supported-systems '("x" "y" "z"))
|
||||||
|
(inputs `(("d" ,d))))))
|
||||||
(list (package-transitive-supported-systems a)
|
(list (package-transitive-supported-systems a)
|
||||||
(package-transitive-supported-systems b)
|
(package-transitive-supported-systems b)
|
||||||
(package-transitive-supported-systems c)
|
(package-transitive-supported-systems c)
|
||||||
(package-transitive-supported-systems d)
|
(package-transitive-supported-systems d)
|
||||||
(package-transitive-supported-systems e))))
|
(package-transitive-supported-systems e))))
|
||||||
|
|
||||||
|
(test-equal "package-transitive-supported-systems, implicit inputs"
|
||||||
|
%supported-systems
|
||||||
|
|
||||||
|
;; Here GNU-BUILD-SYSTEM adds implicit inputs that build only on
|
||||||
|
;; %SUPPORTED-SYSTEMS. Thus the others must be ignored.
|
||||||
|
(let ((p (dummy-package "foo"
|
||||||
|
(build-system gnu-build-system)
|
||||||
|
(supported-systems
|
||||||
|
`("does-not-exist" "foobar" ,@%supported-systems)))))
|
||||||
|
(package-transitive-supported-systems p)))
|
||||||
|
|
||||||
(test-skip (if (not %store) 8 0))
|
(test-skip (if (not %store) 8 0))
|
||||||
|
|
||||||
(test-assert "package-source-derivation, file"
|
(test-assert "package-source-derivation, file"
|
||||||
|
|
Loading…
Reference in New Issue