1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-27 19:41:50 +02:00

packages: Ensure bags are insensitive to '%current-system'.

Fixes <https://bugs.gnu.org/42327>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

This is a followup to f52fbf7094.

* guix/packages.scm (bag-transitive-inputs, bag-transitive-build-inputs)
(bag-transitive-host-inputs, bag-transitive-target-inputs): Parameterize
%CURRENT-SYSTEM in addition to %CURRENT-TARGET-SYSTEM.
* tests/packages.scm ("package->bag, sensitivity to %current-system"):
New test.
This commit is contained in:
Ludovic Courtès
2020-07-13 16:43:58 +02:00
parent 399d89b5c8
commit efb10f175f
2 changed files with 22 additions and 4 deletions
+14
View File
@@ -1110,6 +1110,20 @@
(("dep" package)
(eq? package dep)))))
(test-assert "package->bag, sensitivity to %current-system"
(let* ((dep (dummy-package "dep"
(propagated-inputs (if (string=? (%current-system)
"i586-gnu")
`(("libxml2" ,libxml2))
'()))))
(pkg (dummy-package "foo"
(native-inputs `(("dep" ,dep)))))
(bag (package->bag pkg (%current-system) "i586-gnu")))
(equal? (parameterize ((%current-system "x86_64-linux"))
(bag-transitive-inputs bag))
(parameterize ((%current-system "i586-gnu"))
(bag-transitive-inputs bag)))))
(test-assert "package->bag, sensitivity to %current-target-system"
(let* ((dep (dummy-package "dep"
(propagated-inputs (if (%current-target-system)