diff mbox series

[bug#38612] Pass system and target arguments to gexp->file.

Message ID 8736dl8wxq.fsf@gmail.com
State Superseded
Headers show
Series [bug#38612] Pass system and target arguments to gexp->file. | expand

Commit Message

Mathieu Othacehe Dec. 15, 2019, 2:50 p.m. UTC
In the same spirit, here's another patch to fix profile-derivation.

Mathieu

Comments

Ludovic Courtès Dec. 20, 2019, 9:45 p.m. UTC | #1
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> --- a/guix/profiles.scm
> +++ b/guix/profiles.scm
> @@ -1438,7 +1438,8 @@ MANIFEST."
>                               (locales? #t)
>                               (allow-collisions? #f)
>                               (relative-symlinks? #f)
> -                             system target)
> +                             (system (%current-system))
> +                             (target (%current-target-system)))
>    "Return a derivation that builds a profile (aka. 'user environment') with
>  the given MANIFEST.  The profile includes additional derivations returned by
>  the monadic procedures listed in HOOKS--such as an Info 'dir' file, etc.

AFAICS this change is unnecessary and even incorrect: the

  (mlet* %store-monad ((system (if system
                                   (return system)
                                   (current-system)))

trick ensures that we get the system that current at the time of the
monadic bind, whereas your change get the system and target that are
current at the time of the call.

It’s a terrible pitfall, I know…

Thanks,
Ludo’.
diff mbox series

Patch

From 964f14a8bbd420f0f9207f1a666badaaaf625e3e Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@gmail.com>
Date: Sat, 14 Dec 2019 18:39:59 +0100
Subject: [PATCH] profile-derivation: Use current system and target.

* guix/profiles.scm (profile-derivation): Use current system and target.
---
 guix/profiles.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index 616605151e..a328e40687 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1438,7 +1438,8 @@  MANIFEST."
                              (locales? #t)
                              (allow-collisions? #f)
                              (relative-symlinks? #f)
-                             system target)
+                             (system (%current-system))
+                             (target (%current-target-system)))
   "Return a derivation that builds a profile (aka. 'user environment') with
 the given MANIFEST.  The profile includes additional derivations returned by
 the monadic procedures listed in HOOKS--such as an Info 'dir' file, etc.
-- 
2.24.0