summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-02-17 16:04:15 +0100
committerLudovic Courtès <ludo@gnu.org>2022-02-18 14:14:38 +0100
commit0572737a6218d7390bac352011da47621e18d35b (patch)
tree406b6942629d28f8526a34f53bc1fb40ef858704 /tests
parent9724da9abc3b5719a7cd5ba107444be6b2d50f4a (diff)
downloadguix-0572737a6218d7390bac352011da47621e18d35b.tar.gz
packages: 'package-transitive-supported-systems' ignores '%current-target-system'.
Previously 'package-transitive-supported-systems' would enter an
infinite loop over the cross-compilation tool chain if
%CURRENT-TARGET-SYSTEM was set.

* guix/packages.scm (package-transitive-supported-systems)[supported-systems-procedure]:
Pass explicit SYSTEM and TARGET parameters.
* tests/packages.scm ("supported-package? vs. %current-target-system"):
New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/packages.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index 55b1c4064f..02bdba5f98 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -508,6 +508,16 @@
     (and (supported-package? p "x86_64-linux")
          (supported-package? p "armhf-linux"))))
 
+(test-assert "supported-package? vs. %current-target-system"
+  ;; The %CURRENT-TARGET-SYSTEM value should have no influence.
+  (parameterize ((%current-target-system "arm-linux-gnueabihf"))
+    (let ((p (dummy-package "foo"
+               (build-system gnu-build-system)
+               (supported-systems '("x86_64-linux" "armhf-linux")))))
+      (and (supported-package? p "x86_64-linux")
+           (not (supported-package? p "i686-linux"))
+           (supported-package? p "armhf-linux")))))
+
 (test-skip (if (not %store) 8 0))
 
 (test-assert "package-source-derivation, file"