unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#42247: Channel news raise error on `guix pull`
@ 2020-07-07 14:54 Pierre Neidhardt
  2020-07-09 22:26 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Pierre Neidhardt @ 2020-07-07 14:54 UTC (permalink / raw)
  To: 42247

[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

I've added a news-file entry to my channel:

--8<---------------cut here---------------start------------->8---
(channel
 (version 0)
 (news-file "news.scm"))
--8<---------------cut here---------------end--------------->8---

which contains

--8<---------------cut here---------------start------------->8---
(channel-news
 (version 0)
 (entry (commit "25387230a7f99c2b0886488ed061747c9e00434a")
        (title (en "Hello"))
        (body (en "World!"))))
--8<---------------cut here---------------end--------------->8---

Reading the news file from the REPL works.

--8<---------------cut here---------------start------------->8---
(with-input-from-file "/home/ambrevar/projects/foo/news.scm"
                          (lambda ()
                            (read-channel-news (current-input-port))))
--8<---------------cut here---------------end--------------->8---

However, guix pull chokes on it:

--8<---------------cut here---------------start------------->8---
(repl-version 0 0)
(exception unbound-variable (value #f) (value "Unbound variable: ~S") (value (channel-news)) (value #f))
--8<---------------cut here---------------end--------------->8---

I first encountered this issue in Feb 2020, but this issue might have
been around since channel news were introduced.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#42247: Channel news raise error on `guix pull`
  2020-07-07 14:54 bug#42247: Channel news raise error on `guix pull` Pierre Neidhardt
@ 2020-07-09 22:26 ` Ludovic Courtès
  2020-07-11  9:13   ` Pierre Neidhardt
  2020-07-14  8:53   ` Pierre Neidhardt
  0 siblings, 2 replies; 6+ messages in thread
From: Ludovic Courtès @ 2020-07-09 22:26 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 42247

Hi,

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> 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’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#42247: Channel news raise error on `guix pull`
  2020-07-09 22:26 ` Ludovic Courtès
@ 2020-07-11  9:13   ` Pierre Neidhardt
  2020-07-13 10:27     ` Ludovic Courtès
  2020-07-14  8:53   ` Pierre Neidhardt
  1 sibling, 1 reply; 6+ messages in thread
From: Pierre Neidhardt @ 2020-07-11  9:13 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 42247

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]

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?

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

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#42247: Channel news raise error on `guix pull`
  2020-07-11  9:13   ` Pierre Neidhardt
@ 2020-07-13 10:27     ` Ludovic Courtès
  2020-07-13 12:50       ` Bengt Richter
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2020-07-13 10:27 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 42247

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.

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

Yup, makes sense; would you like to send a patch?

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#42247: Channel news raise error on `guix pull`
  2020-07-13 10:27     ` Ludovic Courtès
@ 2020-07-13 12:50       ` Bengt Richter
  0 siblings, 0 replies; 6+ messages in thread
From: Bengt Richter @ 2020-07-13 12:50 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Pierre Neidhardt, 42247

On +2020-07-13 12:27:39 +0200, Ludovic Courtès wrote:
> 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))

> > 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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#42247: Channel news raise error on `guix pull`
  2020-07-09 22:26 ` Ludovic Courtès
  2020-07-11  9:13   ` Pierre Neidhardt
@ 2020-07-14  8:53   ` Pierre Neidhardt
  1 sibling, 0 replies; 6+ messages in thread
From: Pierre Neidhardt @ 2020-07-14  8:53 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 42247

[-- Attachment #1: Type: text/plain, Size: 77 bytes --]

Done: 42351@debbugs.gnu.org

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-14  8:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07 14:54 bug#42247: Channel news raise error on `guix pull` Pierre Neidhardt
2020-07-09 22:26 ` Ludovic Courtès
2020-07-11  9:13   ` Pierre Neidhardt
2020-07-13 10:27     ` Ludovic Courtès
2020-07-13 12:50       ` Bengt Richter
2020-07-14  8:53   ` Pierre Neidhardt

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).