diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-06-06 21:37:47 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-06-06 23:28:48 +0200 |
commit | b49caaa2b7f624c3395c8e872638282bcc420502 (patch) | |
tree | 8507bbf825fb3dabc155f5f526e63cd39397fcbb /guix/packages.scm | |
parent | 58bb833365db4e8934a386497d5b00a063cfd27d (diff) |
packages: Make 'bag-grafts' insensitive to '%current-target-system'.
Fixes <https://bugs.gnu.org/41713>.
Reported by Mathieu Othacehe.
* guix/packages.scm (bag-grafts): Wrap 'fold-bag-dependencies' calls in
'parameterize'.
* tests/packages.scm ("package->bag, sensitivity to
%current-target-system"): New test.
Diffstat (limited to 'guix/packages.scm')
-rw-r--r-- | guix/packages.scm | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/guix/packages.scm b/guix/packages.scm index 3d9988d836..0ccd31a7a9 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -1277,23 +1277,27 @@ to (see 'graft-derivation'.)" (define native-grafts (let ((->graft (input-graft store system))) - (fold-bag-dependencies (lambda (package grafts) - (match (->graft package) - (#f grafts) - (graft (cons graft grafts)))) - '() - bag))) + (parameterize ((%current-system system) + (%current-target-system #f)) + (fold-bag-dependencies (lambda (package grafts) + (match (->graft package) + (#f grafts) + (graft (cons graft grafts)))) + '() + bag)))) (define target-grafts (if target (let ((->graft (input-cross-graft store target system))) - (fold-bag-dependencies (lambda (package grafts) - (match (->graft package) - (#f grafts) - (graft (cons graft grafts)))) - '() - bag - #:native? #f)) + (parameterize ((%current-system system) + (%current-target-system target)) + (fold-bag-dependencies (lambda (package grafts) + (match (->graft package) + (#f grafts) + (graft (cons graft grafts)))) + '() + bag + #:native? #f))) '())) ;; We can end up with several identical grafts if we stumble upon packages |