Subject: Re: [PATCH] deploy: Support --target and --system.

From: Roman Scherer <[email-masked]>
Date: Fri, 21 Mar 2025 09:24:49 +0100

Hi Sergey,

Sergey Trofimov <[email-masked]> writes:

> Roman Scherer <[email-masked]> writes:
>
>> Hello Sergey,
>>
>> this looks good to me and is better than what we have now. I'm testing
>> this right now and will report back when it went through ...
>>
>
> I think this patch is not necessary at all, your code already sets the
> `system` field of `machine-ssh-configuration` to the value appropriate
> to one returned by hetzner-api.

Oops, looks like I forgot about this. I was looking at this at the
machine and/or OS level.

> It looks to me that the bug is in incorrect parameterization, see the
> following patch. I've been able to deploy using it (again
> `build-locally?` set to #f as it takes too long otherwise). Please test
> this one.

I give it a try and will report back.

>
> --8<---------------cut here---------------start------------->8---
> From 988d192cfe4833761d0714aa8a53392c09dd5c9d Mon Sep 17 00:00:00 2001
> Message-ID: <[email-masked]>
> From: Sergey Trofimov <[email-masked]>
> Subject: [PATCH] machine: ssh: Use monadic parameterize for monads.
>
> * gnu/machine/ssh (deploy-managed-host): Use store-parameterize in
> monadic context.
>
> Change-Id: I6441a5dac856633f2c2a00b77f21a385bf3a9510
> ---
>  gnu/machine/ssh.scm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
> index 73d5dc513e..0ce2860236 100644
> --- a/gnu/machine/ssh.scm
> +++ b/gnu/machine/ssh.scm
> @@ -542,8 +542,8 @@ (define (deploy-managed-host machine)
>                                          host
>                                          (inferior-exception-arguments c))))
>                                os))
> -          (parameterize ((%current-system system)
> -                         (%current-target-system #f))
> +          (store-parameterize ((%current-system system)
> +                               (%current-target-system #f))
>              (with-roll-back #t
>                (mbegin %store-monad
>                  (upgrade-shepherd-services (eval/error-handling c
>
> base-commit: df799a61ef73451e587cb81942c7bfcbbade9e7e