summaryrefslogtreecommitdiff
path: root/tests/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-04-11 12:41:49 +0200
committerLudovic Courtès <ludo@gnu.org>2015-04-11 13:06:23 +0200
commit9bf3ced06c42700d6c83ce3a0eda244798104618 (patch)
tree7df998e019403db4601647bbd83fa7cd30e648d3 /tests/packages.scm
parentcceab87536d0385e406f30dea001d48e9b8f5621 (diff)
downloadpatches-9bf3ced06c42700d6c83ce3a0eda244798104618.tar
patches-9bf3ced06c42700d6c83ce3a0eda244798104618.tar.gz
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.
Diffstat (limited to 'tests/packages.scm')
-rw-r--r--tests/packages.scm41
1 files changed, 32 insertions, 9 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index b50551e963..a93ee66831 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -128,21 +128,44 @@
("y") ;c
("y") ;d
("y")) ;e
- (let* ((a (dummy-package "a" (supported-systems '("x" "y" "z"))))
- (b (dummy-package "b" (supported-systems '("x" "y"))
- (inputs `(("a" ,a)))))
- (c (dummy-package "c" (supported-systems '("y" "z"))
- (inputs `(("b" ,b)))))
- (d (dummy-package "d" (supported-systems '("x" "y" "z"))
- (inputs `(("b" ,b) ("c" ,c)))))
- (e (dummy-package "e" (supported-systems '("x" "y" "z"))
- (inputs `(("d" ,d))))))
+ ;; Use TRIVIAL-BUILD-SYSTEM because it doesn't add implicit inputs and thus
+ ;; doesn't restrict the set of supported systems.
+ (let* ((a (dummy-package "a"
+ (build-system trivial-build-system)
+ (supported-systems '("x" "y" "z"))))
+ (b (dummy-package "b"
+ (build-system trivial-build-system)
+ (supported-systems '("x" "y"))
+ (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)
(package-transitive-supported-systems b)
(package-transitive-supported-systems c)
(package-transitive-supported-systems d)
(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-assert "package-source-derivation, file"