From f52fbf7094c9c346d38ad469cc8d92d18387786e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 14 May 2020 16:03:56 +0200 Subject: packages: Ensure bags are insensitive to '%current-target-system'. Fixes a bug whereby a bag's transitive dependencies would depend on the global '%current-target-system' value. Partly fixes . * guix/packages.scm (bag-transitive-inputs) (bag-transitive-build-inputs, bag-transitive-target-inputs): Parameterize '%current-target-system'. * tests/packages.scm ("package->bag, sensitivity to %current-target-system"): New test. --- tests/packages.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/packages.scm b/tests/packages.scm index 7a8b5e4a2d..c528d2080c 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -1000,6 +1000,19 @@ (define read-at (("dep" package) (eq? package dep))))) +(test-assert "package->bag, sensitivity to %current-target-system" + (let* ((dep (dummy-package "dep" + (propagated-inputs (if (%current-target-system) + `(("libxml2" ,libxml2)) + '())))) + (pkg (dummy-package "foo" + (native-inputs `(("dep" ,dep))))) + (bag (package->bag pkg (%current-system) "foo86-hurd"))) + (equal? (parameterize ((%current-target-system "foo64-gnu")) + (bag-transitive-inputs bag)) + (parameterize ((%current-target-system #f)) + (bag-transitive-inputs bag))))) + (test-assert "bag->derivation" (parameterize ((%graft? #f)) (let ((bag (package->bag gnu-make)) -- cgit v1.2.3