summary refs log tree commit diff
path: root/gnu/system.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-06-14 08:55:03 +0200
committerLudovic Courtès <ludo@gnu.org>2022-06-15 00:25:20 +0200
commit7046e777212233b89df68379c270b448c45195ce (patch)
treecee6e9f7aba177035aeb03b641979eb133a8fc21 /gnu/system.scm
parent9be470b5d2bab7ad2048c95815fee2916d45f4ad (diff)
downloadguix-7046e777212233b89df68379c270b448c45195ce.tar.gz
system: <operating-system> compiler truly honors the 'system' argument.
Fixes <https://issues.guix.gnu.org/55951>.

* gnu/system.scm (operating-system-compiler): Parameterize
'%current-system' and '%current-target-system' before calling
'operating-system-derivation'.
* tests/system.scm ("lower-object, %current-system sensitivity"): New
test.
Diffstat (limited to 'gnu/system.scm')
-rw-r--r--gnu/system.scm11
1 files changed, 8 insertions, 3 deletions
diff --git a/gnu/system.scm b/gnu/system.scm
index 2c81478d00..ba1b7b5152 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1582,8 +1582,13 @@ configurations."
     (lambda (store)
       ;; XXX: This is not super elegant but we can't pass SYSTEM and TARGET to
       ;; 'operating-system-derivation'.
-      (run-with-store store (operating-system-derivation os)
-                      #:system system
-                      #:target target)))))
+      (parameterize ((%current-system system)
+                     (%current-target-system target))
+        (run-with-store store
+          (mbegin %store-monad
+            (set-guile-for-build (default-guile))
+            (operating-system-derivation os))
+          #:system system
+          #:target target))))))
 
 ;;; system.scm ends here