system build: unable to parse multi-line device-mapping

  • Done
  • quality assurance status badge
Details
2 participants
  • Mark H Weaver
  • Vagrant Cascadian
Owner
unassigned
Submitted by
Vagrant Cascadian
Severity
normal
V
V
Vagrant Cascadian wrote on 8 Jan 2018 04:24
(address . bug-guix@gnu.org)
87efn11190.fsf@aikidev.net
After several weeks of not using a machine, and updating guix to

guix (GNU Guix) c04ffadbed7412545555b8be6b78f23eed150d26


Running "guix build system /etc/config.scm" resulted in:

guix system: error: failed to load '/etc/config.scm':
/etc/config.scm:23:9: /etc/config.scm:23:9: In procedure allocate-struct: Wrong type argument in\
position 2: 3


This roughly corresponded to my mapped device section in
/etc/config.scm:

(mapped-devices
(list (mapped-device
(source (uuid "c106e43e-0479-4135-a1a8-b5221312bf74"))
(target "cryptic")
(type luks-device-mapping))))

Moving it all into a single line worked around the issue, but is a good
deal harder to read:

(mapped-devices (list (mapped-device (source (uuid "c106e43e-0479-4135-a1a8-b5221312bf74")) (target "cryptic") (type luks-device-mapping))))


My guess is it has something to do with some commits relating to
validating mapped devices:

42ff7d3be642d66ba567f64882a1f2301b1a7bd9
mapped-devices: 'luks-device-mapping' checks its source device.

4ca90ff5976434a2b6e758df38df54387ae70c1b
mapped-devices: Add 'location' and 'check' fields.


Hope that helps!

live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEcDardHbDotegGFCHt4uC1IFLkbYFAlpS5GsACgkQt4uC1IFL
kbZKRg/5AeAFlktpOMf67jqWyaY7tbNiT0yTXI8vE35tpJfdRu1YbBp5Fgwv6zPP
uVDkyeObjIppWMgtSvb6y7PHCm/7tJUKIZCOSd3GIAjfcCU9TcH9QZjYAqr8HjZy
rnX1MFkLasx98cLrLEsovhLMAbTiprgYmUjKO3grEfqRzfJqlVVKS7aFSTUncdw6
5aJSPGpfmdbhoYO21aghYUFk+ZA7M7xYk8pOdQYojZ/w8x06IehQOKnuQp/eMjEx
skrcR0btd6HVWBR64lSBf3B+BRzuCjIMY0DWsz4dn2fQmvSuXgdjYfVUFps55WZG
8FGroDY30/aNxwx1d7GoxuOG1r4zApgkpIt/52RZhoFu9uT1YGhiUsINEg/DRXPd
QTisN5RehYeJka6YY9J1rL/iT2GYfjmvCLHwdVP7T+N9+Ju8VNpZAWc+7+hGi8en
/Ytn3tzb9iCUgbrpTfYPL9cYZ34LHdUUmp3PISQSmAVM6Rmm6BOJKMKF1Eb3+CWG
Mu0VUxG8ZYjyrxOjhKwHAVJLd5gjJXFxGZNgsMjEzHx4wYkfyW5QYLEsnfZ2aEP8
n0OgPhHX/VNtLsLXRNbpN5mj3NpIk3VHCc6gXIQsii1PQTL9QKZNAyhu4DIIVcP7
EwwdT7XFPT5syAdk9dyV/EjKjHA5h/W1Ep2HAO1YRR/Lif/vM7I=
=dC4Y
-----END PGP SIGNATURE-----

M
M
Mark H Weaver wrote on 8 Jan 2018 06:46
(name . Vagrant Cascadian)(address . vagrant@debian.org)(address . 30021@debbugs.gnu.org)
874lnwdhrl.fsf@netris.org
Hi,

Vagrant Cascadian <vagrant@debian.org> writes:

Toggle quote (21 lines)
> After several weeks of not using a machine, and updating guix to
>
> guix (GNU Guix) c04ffadbed7412545555b8be6b78f23eed150d26
>
>
> Running "guix build system /etc/config.scm" resulted in:
>
> guix system: error: failed to load '/etc/config.scm':
> /etc/config.scm:23:9: /etc/config.scm:23:9: In procedure allocate-struct: Wrong type argument in\
> position 2: 3
>
>
> This roughly corresponded to my mapped device section in
> /etc/config.scm:
>
> (mapped-devices
> (list (mapped-device
> (source (uuid "c106e43e-0479-4135-a1a8-b5221312bf74"))
> (target "cryptic")
> (type luks-device-mapping))))

I ran into the same problem.

Toggle quote (15 lines)
> Moving it all into a single line worked around the issue, but is a good
> deal harder to read:
>
> (mapped-devices (list (mapped-device (source (uuid "c106e43e-0479-4135-a1a8-b5221312bf74")) (target "cryptic") (type luks-device-mapping))))
>
>
> My guess is it has something to do with some commits relating to
> validating mapped devices:
>
> 42ff7d3be642d66ba567f64882a1f2301b1a7bd9
> mapped-devices: 'luks-device-mapping' checks its source device.
>
> 4ca90ff5976434a2b6e758df38df54387ae70c1b
> mapped-devices: Add 'location' and 'check' fields.

You're right that it has to do with those commits, but the work around
simply involves forcing a recompilation of /etc/config.scm. *Any*
change to config.scm would have fixed the problem, or alternatively you
could have deleted ~/.cache/guile/ccache. In any case, you can now
reformat the mapped device section as it was before, and it will
continue to work.

What happened here is that commit 4ca90ff5 added two fields to the
<mapped-device> record type. For efficiency reasons, the
'mapped-device' record constructor (used in /etc/config.scm) is an
*inlined* procedure. Unfortunately this means that the compiled version
of /etc/config.scm in ~/.cache/guile/ccache was still creating the old
record type. Guile is not able to detect this case, so the cache must
be manually invalidated somehow.

Mark
M
M
Mark H Weaver wrote on 8 Jan 2018 06:49
(name . Vagrant Cascadian)(address . vagrant@debian.org)(address . 30021-done@debbugs.gnu.org)
87zi5oc334.fsf@netris.org
Vagrant Cascadian <vagrant@debian.org> writes:

Toggle quote (6 lines)
> Running "guix build system /etc/config.scm" resulted in:
>
> guix system: error: failed to load '/etc/config.scm':
> /etc/config.scm:23:9: /etc/config.scm:23:9: In procedure allocate-struct: Wrong type argument in\
> position 2: 3

I forgot to mention that there's already a bug filed for this issue:


I'm closing this bug now.

Thanks,
Mark
Closed
?