Subject: bug#41236: guix deploy error message can be too obscure to understand

From: Brice Waegeneire <[email-masked]>
Date: Wed, 13 May 2020 15:42:16 +0000

Hello again,

Guix deploy errors message can be hard to understand, see the following
output for example:

--8<---------------cut here---------------start------------->8---
$ guix deploy -Lmodules systems/hystou-p04.scm
guix deploy: warning: failed to load '(config workstation)':
no code for module (gnu services lightdm)
The following 1 machine will be deployed:
   abricot

guix deploy: deploying to abricot...
sending 0 store items (0 MiB) to '192.168.10.10'...
sending 0 store items (0 MiB) to '192.168.10.10'...
guix deploy: error: failed to deploy abricot: Wrong type argument in 
position 1 (expecting struct): ~S
--8<---------------cut here---------------end--------------->8---

By using “guix repl“ I managed to understand that I was setting a field 
to
a undeclared variable: “keyboard-layout“.  A stupid mistake on my part 
that
should have been trivial to spot took hours instead because the error
message was obscure.

--8<---------------cut here---------------start------------->8---
(operating-system
   …
   (bootloader
     (bootloader-configuration
        …
       (keyboard-layout keyboard-layout))))
--8<---------------cut here---------------end--------------->8---

- Brice