Channel news raise error on `guix pull`

  • Done
  • quality assurance status badge
Details
3 participants
  • Bengt Richter
  • Ludovic Courtès
  • Pierre Neidhardt
Owner
unassigned
Submitted by
Pierre Neidhardt
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 have
been around since channel news were introduced.

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl8EjJ4ACgkQm9z0l6S7
zH8TDwgAlIYU3Z14JyoTdGbgRiRR1Yn+alMPcVWv+8Us0biAVrU1oZu7fJM+7tQL
UajIdW13xtBvzdnYggAAxR3OATED31+T+r30MQorEEHWx0ACpZE8lJ3YLAMJK8bf
8dpCKzU8R6ZnmfU1C31noYRQtxK2U22yP/xQzQDjmHrKlsuhxJsaE88QbF/2DZA/
CnN8fAPmDg1+ZSH85M8Dqzc5NqXAd92wgu0OA5rA3LuCUV7+i1elzrYMus2XczWb
v4REKT2LI1JQdQWLYEQAsdUTxL4q+RiPo+w9TuIUohQWsQeotvC5Csw/nbxf0hdw
jM++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 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").

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 notabug
close 42247
quit
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 more
intelligible error message?

2. I suggest we document this pitfall in the documentation.

Cheers!

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl8JgrQACgkQm9z0l6S7
zH+UnQf/aWnVQJHLvY+cpfffFce/voeV/AGheP3WdZCBFyrIuYRsK2Slbqz3wRHn
TkJ4U91nxvwZkKsXFHDGvfTBDMfSmX2t8Ov83Xxssj8RdKAI0R5rpx2bh8rhHADM
A6Up0UJXXtIHzo5ET2qaexkhpfSYaDJHicHdxNcxCwlBdUr1RVxwW4Pfcf/nmOdk
JNXGWTQemLSdSUqlshx0MO6iBNIbgvy2t5h5IqQsLOPuxlncp6PnlZytuAyulIOp
nnLq3NdJJZ19cX0CsXIcUF3CQEJ4Kc+Au4FlSDKjtEm4mqh0mlhVDY7cnoQ6JXxF
Z6w5yOfzaGUiE7Q3sKNTidKic74JUA==
=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 .scm
files.

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 data
when "Guile is just doing its job ..." are you?? (unless the producer
of the filename is contracted to guarantee the extension semantics in
guile'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 Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl8NcqYACgkQm9z0l6S7
zH8EgggAjen3pfioM+Iu1B1+bTbsf3KJqqPa80b1KQ48+xmHRn1Sp3lEDaW41Hyz
JDzrWRP989qJqZUj2Yiq2LAr0DFUlKDmuhf1vZggdX4zT1D5toQerzfjk2+hwPpK
YqKKWNa3G4tGePI05UG9E6u8L05GzykhJ5PmyMQQbhS5VWmLSASMtpUmQXqmr9C1
1tJpF8lqKnAeNOOtJlcVoamOEXuJVuwipEnjuVafhJNV3O+jp0S9K3ERZkLq+Ep+
ptM/VHQhzKishPvdKNkDlbKbrJ6I+kR/GYrg8rCJAB5tX5kbn+1vDR7plKUlIOAs
GujO3NzzWeFOKrHnsXmjs2SUbesMkw==
=BFv3
-----END PGP SIGNATURE-----

?