[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/08: packages: Ensure bags are insensitive to '%current-target-system'
From: |
guix-commits |
Subject: |
02/08: packages: Ensure bags are insensitive to '%current-target-system'. |
Date: |
Thu, 14 May 2020 11:22:09 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit f52fbf7094c9c346d38ad469cc8d92d18387786e
Author: Ludovic Courtès <address@hidden>
AuthorDate: Thu May 14 16:03:56 2020 +0200
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.
---
guix/packages.scm | 9 ++++++---
tests/packages.scm | 13 +++++++++++++
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/guix/packages.scm b/guix/packages.scm
index 9fdc679..3fff50a 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
diff --git a/tests/packages.scm b/tests/packages.scm
index 7a8b5e4..c528d20 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -1000,6 +1000,19 @@
(("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))
- branch master updated (19e8a75 -> febd1fc), guix-commits, 2020/05/14
- 03/08: store: 'mapm/accumulate-builds' preserves '%current-target-system'., guix-commits, 2020/05/14
- 04/08: pack: Wrapper honors 'GUIX_EXECUTION_ENGINE' environment variable., guix-commits, 2020/05/14
- 05/08: pack: Factorize store references in wrapper., guix-commits, 2020/05/14
- 08/08: news: Add news entry for 'guix pack -RR' and Fakechroot., guix-commits, 2020/05/14
- 06/08: gnu: Add fakechroot., guix-commits, 2020/05/14
- 07/08: pack: Add relocation via ld.so and fakechroot., guix-commits, 2020/05/14
- 01/08: pack: Do not cross-compile the image building tools., guix-commits, 2020/05/14
- 02/08: packages: Ensure bags are insensitive to '%current-target-system'.,
guix-commits <=