diff mbox series

[bug#41785,v3,1/2] image: Make 'find-image' non-monadic.

Message ID 87imftkel5.fsf@gnu.org
State Accepted
Headers show
Series [bug#41785,v3,1/2] image: Make 'find-image' non-monadic. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job

Commit Message

Mathieu Othacehe June 14, 2020, 12:37 p.m. UTC
Hey!

>>> +      ((image ->  (find-image file-system-type (%current-target-system)))
>>>         (sys       (system-derivation-for-action os image action
>>>                                                  #:file-system-type file-system-type
>>>                                                  #:image-size image-size
>>
>> Same here, otherwise this look good to me.

I missed something, "target" variable is shadowing the "target"
argument. The attached patch should fix the issue, I'm testing it.

Thanks,

Mathieu

Comments

Janneke Nieuwenhuizen June 14, 2020, 1:12 p.m. UTC | #1
Mathieu Othacehe writes:

Hi Mathieu,

>>>> +      ((image ->  (find-image file-system-type (%current-target-system)))
>>>>         (sys       (system-derivation-for-action os image action
>>>>                                                  #:file-system-type file-system-type
>>>>                                                  #:image-size image-size
>>>
>>> Same here, otherwise this look good to me.
>
> I missed something, "target" variable is shadowing the "target"
> argument. The attached patch should fix the issue, I'm testing it.

Oops!

> From 760e46d2ff57fab2b67656b85d800572bbc56f4b Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <othacehe@gnu.org>
> Date: Sun, 14 Jun 2020 14:16:37 +0200
> Subject: [PATCH] scripts: system: Fix "init" command.
>
> This is a follow-up of 7ca533c7237622d70b423033c4506217d9ce4014. The
> introduced "target" variable is shadowing the target argument.
>
> * guix/scripts/system.scm (perform-action): Rename "target" variable to
> "target*".
> ---
>  guix/scripts/system.scm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
> index 6769a602b1..212b49f008 100644
> --- a/guix/scripts/system.scm
> +++ b/guix/scripts/system.scm
> @@ -802,8 +802,8 @@ static checks."
>        (check-initrd-modules os)))
>  
>    (mlet* %store-monad
> -      ((target    (current-target-system))
> -       (image ->  (find-image file-system-type target))
> +      ((target*   (current-target-system))
> +       (image ->  (find-image file-system-type target*))
>         (sys       (system-derivation-for-action os image action
>                                                  #:file-system-type file-system-type
>                                                  #:image-size image-size

Yeah, that looks right!  I didn't notice either.  I could have been more
careful/suspicious, as in the other, similar case in
gnu/tests/install.scm I moved

         (target (operating-system-derivation target-os))

down to have mlet* do the shadowing properly.

Janneke
Janneke Nieuwenhuizen June 14, 2020, 1:32 p.m. UTC | #2
Jan Nieuwenhuizen writes:

Hello again,

>>>>> +      ((image ->  (find-image file-system-type (%current-target-system)))
>>>>>         (sys       (system-derivation-for-action os image action
>>>>>                                                  #:file-system-type file-system-type
>>>>>                                                  #:image-size image-size
>>>>
>>>> Same here, otherwise this look good to me.
>>
>> I missed something, "target" variable is shadowing the "target"
>> argument. The attached patch should fix the issue, I'm testing it.
>
> Oops!
>
>> From 760e46d2ff57fab2b67656b85d800572bbc56f4b Mon Sep 17 00:00:00 2001
>> From: Mathieu Othacehe <othacehe@gnu.org>
>> Date: Sun, 14 Jun 2020 14:16:37 +0200
>> Subject: [PATCH] scripts: system: Fix "init" command.

Just to confirm that this fixes

    make check-system TESTS="installed-extlinux-os"

failing early, where it now possibly fails for lack of disk
space...retrying...

Janneke
Mathieu Othacehe June 14, 2020, 3:44 p.m. UTC | #3
> Just to confirm that this fixes
>
>     make check-system TESTS="installed-extlinux-os"

Ok, thanks for checking. I pushed this one.

> failing early, where it now possibly fails for lack of disk
> space...retrying...

Yup, that's another issue I'm working on!

Thanks,

Mathieu
diff mbox series

Patch

From 760e46d2ff57fab2b67656b85d800572bbc56f4b Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Sun, 14 Jun 2020 14:16:37 +0200
Subject: [PATCH] scripts: system: Fix "init" command.

This is a follow-up of 7ca533c7237622d70b423033c4506217d9ce4014. The
introduced "target" variable is shadowing the target argument.

* guix/scripts/system.scm (perform-action): Rename "target" variable to
"target*".
---
 guix/scripts/system.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 6769a602b1..212b49f008 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -802,8 +802,8 @@  static checks."
       (check-initrd-modules os)))
 
   (mlet* %store-monad
-      ((target    (current-target-system))
-       (image ->  (find-image file-system-type target))
+      ((target*   (current-target-system))
+       (image ->  (find-image file-system-type target*))
        (sys       (system-derivation-for-action os image action
                                                 #:file-system-type file-system-type
                                                 #:image-size image-size
-- 
2.26.2