guix-commits
[Top][All Lists]
Advanced

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

02/04: services: profile: Create manifest at monadic-bind time.


From: guix-commits
Subject: 02/04: services: profile: Create manifest at monadic-bind time.
Date: Mon, 30 Nov 2020 18:11:30 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 07a33b1d21e240781072352f93206cfdc765f907
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Nov 30 23:16:57 2020 +0100

    services: profile: Create manifest at monadic-bind time.
    
    Fixes <https://bugs.gnu.org/44952>.
    Reported by Mathieu Othacehe <othacehe@gnu.org>.
    
    * gnu/services.scm (packages->profile-entry): Change 'with-monad' to
    'mlet' with one binding.
---
 gnu/services.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/services.scm b/gnu/services.scm
index 4b30399..13259df 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -788,7 +788,13 @@ executables, making them setuid-root.")))
 
 (define (packages->profile-entry packages)
   "Return a system entry for the profile containing PACKAGES."
-  (with-monad %store-monad
+  ;; XXX: 'mlet' is needed here for one reason: to get the proper
+  ;; '%current-target' and '%current-target-system' bindings when
+  ;; 'packages->manifest' is called, and thus when the 'package-inputs'
+  ;; etc. procedures are called on PACKAGES.  That way, conditionals in those
+  ;; inputs see the "correct" value of these two parameters.  See
+  ;; <https://issues.guix.gnu.org/44952>.
+  (mlet %store-monad ((_ (current-target-system)))
     (return `(("profile" ,(profile
                            (content (packages->manifest
                                      (delete-duplicates packages eq?)))))))))



reply via email to

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