summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-05-14 16:03:56 +0200
committerLudovic Courtès <ludo@gnu.org>2020-05-14 17:21:27 +0200
commitf52fbf7094c9c346d38ad469cc8d92d18387786e (patch)
tree954c567a163e6547aa7988063f9183c72112df40 /guix
parenta89df83c79340b5d0dfefcc6250dc69d502f3f5d (diff)
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 <https://issues.guix.gnu.org/41182>. * 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.
Diffstat (limited to 'guix')
-rw-r--r--guix/packages.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index 9fdc679f9a..3fff50a6e8 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -814,11 +814,13 @@ dependencies are known to build on SYSTEM."
(define (bag-transitive-inputs bag)
"Same as 'package-transitive-inputs', but applied to a bag."
- (transitive-inputs (bag-direct-inputs bag)))
+ (parameterize ((%current-target-system #f))
+ (transitive-inputs (bag-direct-inputs bag))))
(define (bag-transitive-build-inputs bag)
"Same as 'package-transitive-native-inputs', but applied to a bag."
- (transitive-inputs (bag-build-inputs bag)))
+ (parameterize ((%current-target-system #f))
+ (transitive-inputs (bag-build-inputs bag))))
(define (bag-transitive-host-inputs bag)
"Same as 'package-transitive-target-inputs', but applied to a bag."
@@ -827,7 +829,8 @@ dependencies are known to build on SYSTEM."
(define (bag-transitive-target-inputs bag)
"Return the \"target inputs\" of BAG, recursively."
- (transitive-inputs (bag-target-inputs bag)))
+ (parameterize ((%current-target-system (bag-target bag)))
+ (transitive-inputs (bag-target-inputs bag))))
(define* (package-closure packages #:key (system (%current-system)))
"Return the closure of PACKAGES on SYSTEM--i.e., PACKAGES and the list of