guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: packages: Ensure bags are insensitive to '%curren


From: guix-commits
Subject: branch master updated: packages: Ensure bags are insensitive to '%current-system'.
Date: Mon, 13 Jul 2020 10:49:31 -0400

This is an automated email from the git hooks/post-receive script.

civodul pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new efb10f1  packages: Ensure bags are insensitive to '%current-system'.
efb10f1 is described below

commit efb10f175fa6323024aa471c58ea1da445085298
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jul 13 16:43:58 2020 +0200

    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.
---
 guix/packages.scm  | 12 ++++++++----
 tests/packages.scm | 14 ++++++++++++++
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index 68ef718..95d7c2c 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -923,22 +923,26 @@ dependencies are known to build on SYSTEM."
 
 (define (bag-transitive-inputs bag)
   "Same as 'package-transitive-inputs', but applied to a bag."
-  (parameterize ((%current-target-system #f))
+  (parameterize ((%current-target-system #f)
+                 (%current-system (bag-system bag)))
     (transitive-inputs (bag-direct-inputs bag))))
 
 (define (bag-transitive-build-inputs bag)
   "Same as 'package-transitive-native-inputs', but applied to a bag."
-  (parameterize ((%current-target-system #f))
+  (parameterize ((%current-target-system #f)
+                 (%current-system (bag-system bag)))
     (transitive-inputs (bag-build-inputs bag))))
 
 (define (bag-transitive-host-inputs bag)
   "Same as 'package-transitive-target-inputs', but applied to a bag."
-  (parameterize ((%current-target-system (bag-target bag)))
+  (parameterize ((%current-target-system (bag-target bag))
+                 (%current-system (bag-system bag)))
     (transitive-inputs (bag-host-inputs bag))))
 
 (define (bag-transitive-target-inputs bag)
   "Return the \"target inputs\" of BAG, recursively."
-  (parameterize ((%current-target-system (bag-target bag)))
+  (parameterize ((%current-target-system (bag-target bag))
+                 (%current-system (bag-system bag)))
     (transitive-inputs (bag-target-inputs bag))))
 
 (define* (package-closure packages #:key (system (%current-system)))
diff --git a/tests/packages.scm b/tests/packages.scm
index 26377b2..6aa3617 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]