diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-07-13 16:43:58 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-07-13 16:49:12 +0200 |
commit | efb10f175fa6323024aa471c58ea1da445085298 (patch) | |
tree | 8eba01ff5cfc68261510776e6dc5cf58259f6c2a /tests | |
parent | 399d89b5c8cf60f0ef4f4f5e1699c5d92a51f015 (diff) | |
download | guix-efb10f175fa6323024aa471c58ea1da445085298.tar.gz guix-efb10f175fa6323024aa471c58ea1da445085298.zip |
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 f52fbf7094c9c346d38ad469cc8d92d18387786e.
* 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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/packages.scm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm index 26377b269b..6aa36170d2 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -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) |