Channel news raise error on `guix pull`

DoneSubmitted by Pierre Neidhardt.
Details
3 participants
  • Bengt Richter
  • Ludovic Courtès
  • Pierre Neidhardt
Owner
unassigned
Severity
normal
P
P
Pierre Neidhardt wrote on 7 Jul 2020 16:54
(address . bug-guix@gnu.org)
875zaz2x5t.fsf@ambrevar.xyz
I've added a news-file entry to my channel:
Toggle snippet (5 lines)(channel (version 0) (news-file "news.scm"))
which contains
Toggle snippet (7 lines)(channel-news (version 0) (entry (commit "25387230a7f99c2b0886488ed061747c9e00434a") (title (en "Hello")) (body (en "World!"))))
Reading the news file from the REPL works.
Toggle snippet (5 lines)(with-input-from-file "/home/ambrevar/projects/foo/news.scm" (lambda () (read-channel-news (current-input-port))))
However, guix pull chokes on it:
Toggle snippet (4 lines)(repl-version 0 0)(exception unbound-variable (value #f) (value "Unbound variable: ~S") (value (channel-news)) (value #f))
I first encountered this issue in Feb 2020, but this issue might havebeen around since channel news were introduced.
-- Pierre Neidhardthttps://ambrevar.xyz/
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl8EjJ4ACgkQm9z0l6S7zH8TDwgAlIYU3Z14JyoTdGbgRiRR1Yn+alMPcVWv+8Us0biAVrU1oZu7fJM+7tQLUajIdW13xtBvzdnYggAAxR3OATED31+T+r30MQorEEHWx0ACpZE8lJ3YLAMJK8bf8dpCKzU8R6ZnmfU1C31noYRQtxK2U22yP/xQzQDjmHrKlsuhxJsaE88QbF/2DZA/CnN8fAPmDg1+ZSH85M8Dqzc5NqXAd92wgu0OA5rA3LuCUV7+i1elzrYMus2XczWbv4REKT2LI1JQdQWLYEQAsdUTxL4q+RiPo+w9TuIUohQWsQeotvC5Csw/nbxf0hdwjM++e/fyJO1SFHDb/ZBXXBz32aaKuw===kmRY-----END PGP SIGNATURE-----
L
L
Ludovic Courtès wrote on 10 Jul 2020 00:26
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 42247@debbugs.gnu.org)
87imew9vfk.fsf@gnu.org
Hi,
Pierre Neidhardt <mail@ambrevar.xyz> skribis:
Toggle quote (5 lines)> However, guix pull chokes on it:>> (repl-version 0 0)> (exception unbound-variable (value #f) (value "Unbound variable: ~S") (value (channel-news)) (value #f))
This suggests that the ‘news.scm’ file of your channel is being pickedup and evaluated as if it were a module, which it’s not.
The solution is to rename it to, say, ‘news.txt’, or to move the actualmodules to a sub-directory and specify that in ‘.guix-channel’ (info"(guix) Channels").
HTH!
Ludo’.
L
L
Ludovic Courtès wrote on 10 Jul 2020 00:26
control message for bug #42247
(address . control@debbugs.gnu.org)
87h7ug9vf6.fsf@gnu.org
tags 42247 notabugclose 42247quit
P
P
Pierre Neidhardt wrote on 11 Jul 2020 11:13
Re: bug#42247: Channel news raise error on `guix pull`
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 42247@debbugs.gnu.org)
87mu46qurv.fsf@ambrevar.xyz
Ludovic Courtès <ludo@gnu.org> writes:
Toggle quote (7 lines)> This suggests that the ‘news.scm’ file of your channel is being picked> up and evaluated as if it were a module, which it’s not.>> The solution is to rename it to, say, ‘news.txt’, or to move the actual> modules to a sub-directory and specify that in ‘.guix-channel’ (info> "(guix) Channels").
Thanks for the hint, this works indeed!
1. Is there anything we can do to catch this error and output a moreintelligible error message?
2. I suggest we document this pitfall in the documentation.
Cheers!
-- Pierre Neidhardthttps://ambrevar.xyz/
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl8JgrQACgkQm9z0l6S7zH+UnQf/aWnVQJHLvY+cpfffFce/voeV/AGheP3WdZCBFyrIuYRsK2Slbqz3wRHnTkJ4U91nxvwZkKsXFHDGvfTBDMfSmX2t8Ov83Xxssj8RdKAI0R5rpx2bh8rhHADMA6Up0UJXXtIHzo5ET2qaexkhpfSYaDJHicHdxNcxCwlBdUr1RVxwW4Pfcf/nmOdkJNXGWTQemLSdSUqlshx0MO6iBNIbgvy2t5h5IqQsLOPuxlncp6PnlZytuAyulIOpnnLq3NdJJZ19cX0CsXIcUF3CQEJ4Kc+Au4FlSDKjtEm4mqh0mlhVDY7cnoQ6JXxFZ6w5yOfzaGUiE7Q3sKNTidKic74JUA===we+1-----END PGP SIGNATURE-----
L
L
Ludovic Courtès wrote on 13 Jul 2020 12:27
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 42247@debbugs.gnu.org)
875zaru2uc.fsf@gnu.org
Hi,
Pierre Neidhardt <mail@ambrevar.xyz> skribis:
Toggle quote (14 lines)> Ludovic Courtès <ludo@gnu.org> writes:>>> This suggests that the ‘news.scm’ file of your channel is being picked>> up and evaluated as if it were a module, which it’s not.>>>> The solution is to rename it to, say, ‘news.txt’, or to move the actual>> modules to a sub-directory and specify that in ‘.guix-channel’ (info>> "(guix) Channels").>> Thanks for the hint, this works indeed!>> 1. Is there anything we can do to catch this error and output a more> intelligible error message?
I don’t think so: Guile is just doing its job and picking up .scmfiles.
Toggle quote (2 lines)> 2. I suggest we document this pitfall in the documentation.
Yup, makes sense; would you like to send a patch?
Thanks,Ludo’.
B
B
Bengt Richter wrote on 13 Jul 2020 14:50
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200713125023.GA2937@LionPure
On +2020-07-13 12:27:39 +0200, Ludovic Courtès wrote:
Toggle quote (22 lines)> Hi,> > Pierre Neidhardt <mail@ambrevar.xyz> skribis:> > > Ludovic Courtès <ludo@gnu.org> writes:> >> >> This suggests that the ‘news.scm’ file of your channel is being picked> >> up and evaluated as if it were a module, which it’s not.> >>> >> The solution is to rename it to, say, ‘news.txt’, or to move the actual> >> modules to a sub-directory and specify that in ‘.guix-channel’ (info> >> "(guix) Channels").> >> > Thanks for the hint, this works indeed!> >> > 1. Is there anything we can do to catch this error and output a more> > intelligible error message?> > I don’t think so: Guile is just doing its job and picking up .scm> files.>
You are not saying that a file extension is used as hard type datawhen "Guile is just doing its job ..." are you?? (unless the producerof the filename is contracted to guarantee the extension semantics inguile's environment at the run-time in question ...but where is such policy documented, if so? (I don't mean looking for.go files newer than corresponding .scm, etc))
Toggle quote (10 lines)> > 2. I suggest we document this pitfall in the documentation.> > Yup, makes sense; would you like to send a patch?> > Thanks,> Ludo’.> > >
-- Regards,Bengt Richter
P
P
Pierre Neidhardt wrote on 14 Jul 2020 10:53
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 42247@debbugs.gnu.org)
87k0z6xys9.fsf@ambrevar.xyz
Done: 42351@debbugs.gnu.org
-- Pierre Neidhardthttps://ambrevar.xyz/
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl8NcqYACgkQm9z0l6S7zH8EgggAjen3pfioM+Iu1B1+bTbsf3KJqqPa80b1KQ48+xmHRn1Sp3lEDaW41HyzJDzrWRP989qJqZUj2Yiq2LAr0DFUlKDmuhf1vZggdX4zT1D5toQerzfjk2+hwPpKYqKKWNa3G4tGePI05UG9E6u8L05GzykhJ5PmyMQQbhS5VWmLSASMtpUmQXqmr9C11tJpF8lqKnAeNOOtJlcVoamOEXuJVuwipEnjuVafhJNV3O+jp0S9K3ERZkLq+Ep+ptM/VHQhzKishPvdKNkDlbKbrJ6I+kR/GYrg8rCJAB5tX5kbn+1vDR7plKUlIOAsGujO3NzzWeFOKrHnsXmjs2SUbesMkw===BFv3-----END PGP SIGNATURE-----
?