Hi Carlo,

This isn't much worse than doing the reconfigure on the system itself,
though. You can always have another ssh session open as root to recover
from a faulty deployment with a "guix system roll-back".
Thank you - I naively thought a deploy would close existing ssh connections. Happy to learn it doesn't!

Something like this should let you write whatever condition you want.
The condition would be checked on the local machine, and the roll-back
would be triggered using the one persistent ssh connection that "guix
deploy" establishes.
I think this is exactly what I want. `deploy-managed-host` is not exported by `(gnu machine ssh)` so I had to get it with module-ref. I think I managed to figure out the correct modules to include, but I haven't been able to get it working. i've been trying it with just defining deployment-okay? as #t/#f, but I get errors in both cases. In both cases it's "wrong type to apply" but I can't figure out what's being apply-ed.

Here's the traceback in one case:

Backtrace:
In guix/scripts/deploy.scm:
   347:23 19 (_)
In guix/store.scm:
  1234:13 18 (map/accumulate-builds #<store-connection 256.100 7fed…> …)
  1234:13 17 (map/accumulate-builds #<store-connection 256.100 7fed…> …)
  1234:13 16 (map/accumulate-builds #<store-connection 256.100 7fed…> …)
  1234:13 15 (map/accumulate-builds #<store-connection 256.100 7fed…> …)
  1234:13 14 (map/accumulate-builds #<store-connection 256.100 7fed…> …)
  1234:13 13 (map/accumulate-builds #<store-connection 256.100 7fed…> …)
  1234:13 12 (map/accumulate-builds #<store-connection 256.100 7fed…> …)
  1209:11 11 (map/accumulate-builds #<store-connection 256.100 7fed…> …)
   1127:8 10 (call-with-build-handler #<procedure 7fedd4973c90 at g…> …)
In ice-9/boot-9.scm:
  1784:12  9 (with-exception-handler _ _ #:unwind? _ # _)
In guix/scripts/deploy.scm:
    191:6  8 (_)
In guix/store.scm:
  1864:25  7 (run-with-store #<store-connection 256.100 7fedf0261e80> …)
  1864:25  6 (run-with-store #<store-connection 256.100 7feddd1ae580> …)
In ice-9/boot-9.scm:
  1705:22  5 (raise-exception _ #:continuable? _)
In guix/scripts/deploy.scm:
   172:12  4 (_ _)
In ice-9/boot-9.scm:
  1705:22  3 (raise-exception _ #:continuable? _)
In guix/store.scm:
   519:30  2 (_ _)
In ice-9/boot-9.scm:
  1705:22  1 (raise-exception _ #:continuable? _)
In guix/ui.scm:
   920:18  0 (_ _)

guix/ui.scm:920:18: Wrong type to apply: #<unspecified>

I did try to cross-reference that with the guix source. Line 172 in guix/scripts/deploy.scm seems to be the block that handles the exception, and I suppose we actually want to be around line 185 (which is the `(deploy-error? c)` block). I guess I am instantiating the condition wrong, but I don't know how it's supposed to look.

Thanks again for your help,

Dan

Reply via email to