GNU bug report logs - #61977
[PATCH] channels: Raise an error if dependency's introduction is malformed

Previous Next

Package: guix-patches;

Reported by: Josselin Poiret <dev <at> jpoiret.xyz>

Date: Sun, 5 Mar 2023 10:57:02 UTC

Severity: normal

Tags: patch

Done: Josselin Poiret <dev <at> jpoiret.xyz>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61977 in the body.
You can then email your comments to 61977 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#61977; Package guix-patches. (Sun, 05 Mar 2023 10:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Josselin Poiret <dev <at> jpoiret.xyz>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 05 Mar 2023 10:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: guix-patches <at> gnu.org
Cc: Josselin Poiret <dev <at> jpoiret.xyz>
Subject: [PATCH] channels: Raise an error if dependency's introduction is
 malformed
Date: Sun,  5 Mar 2023 11:56:09 +0100
* guix/channels.scm (sexp->channel-introduction): Do it.
---
 guix/channels.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/guix/channels.scm b/guix/channels.scm
index d44e7a0a3a..fc2bf55d65 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -256,7 +256,14 @@ (define sexp->channel-introduction
                             ('commit commit) ('signer signer)
                             _ ...)
      (make-channel-introduction commit (openpgp-fingerprint signer)))
-    (x #f)))
+    (x (raise (condition
+               (&message
+                (message (format #f "channel dependency has an invalid\
+ introduction field")))
+               (&error-location
+                (location
+                 (source-properties->location
+                  (source-properties x)))))))))
 
 (define (read-channel-metadata port)
   "Read from PORT channel metadata in the format expected for the

base-commit: 2799ad44234be675f018115f99be98d2c9fd565d
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#61977; Package guix-patches. (Fri, 17 Mar 2023 22:15:02 GMT) Full text and rfc822 format available.

Message #8 received at 61977 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Josselin Poiret <dev <at> jpoiret.xyz>
Cc: 61977 <at> debbugs.gnu.org
Subject: Re: bug#61977: [PATCH] channels: Raise an error if dependency's
 introduction is malformed
Date: Fri, 17 Mar 2023 23:14:06 +0100
Hi Josselin,

Josselin Poiret <dev <at> jpoiret.xyz> skribis:

> * guix/channels.scm (sexp->channel-introduction): Do it.

To be clear, without this a malformed introduction sexp would be
silently ignored; consequently, the channel in question would not be
authenticated, in which case the “channel '~a' lacks 'introduction'
field” warning would be printed.  Am I right?

So the goal here is to catch errors in ‘.guix-channel’ earlier, right?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#61977; Package guix-patches. (Sat, 18 Mar 2023 21:43:02 GMT) Full text and rfc822 format available.

Message #11 received at 61977 <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 61977 <at> debbugs.gnu.org
Subject: Re: bug#61977: [PATCH] channels: Raise an error if dependency's
 introduction is malformed
Date: Sat, 18 Mar 2023 22:42:01 +0100
[Message part 1 (text/plain, inline)]
Hi Ludo,

Ludovic Courtès <ludo <at> gnu.org> writes:

> Hi Josselin,
>
> Josselin Poiret <dev <at> jpoiret.xyz> skribis:
>
>> * guix/channels.scm (sexp->channel-introduction): Do it.
>
> To be clear, without this a malformed introduction sexp would be
> silently ignored; consequently, the channel in question would not be
> authenticated, in which case the “channel '~a' lacks 'introduction'
> field” warning would be printed.  Am I right?
>
> So the goal here is to catch errors in ‘.guix-channel’ earlier, right?

Exactly!  Someone else reported this elsewhere because they were using
the syntax for a channels.scm file instead of the channel dependencies
syntax, which is different, and consumers of that channel kept getting
warning messages.

Best,
-- 
Josselin Poiret
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#61977; Package guix-patches. (Fri, 05 May 2023 14:17:02 GMT) Full text and rfc822 format available.

Message #14 received at 61977 <at> debbugs.gnu.org (full text, mbox):

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: Josselin Poiret <dev <at> jpoiret.xyz>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 61977 <at> debbugs.gnu.org
Subject: Re: bug#61977: [PATCH] channels: Raise an error if dependency's
 introduction is malformed
Date: Fri, 05 May 2023 16:15:18 +0200
Hi,

What is the status of this patch?

On dim., 05 mars 2023 at 11:56, Josselin Poiret <dev <at> jpoiret.xyz> wrote:
> * guix/channels.scm (sexp->channel-introduction): Do it.
> ---
>  guix/channels.scm | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/guix/channels.scm b/guix/channels.scm
> index d44e7a0a3a..fc2bf55d65 100644
> --- a/guix/channels.scm
> +++ b/guix/channels.scm
> @@ -256,7 +256,14 @@ (define sexp->channel-introduction
>                              ('commit commit) ('signer signer)
>                              _ ...)
>       (make-channel-introduction commit (openpgp-fingerprint signer)))
> -    (x #f)))
> +    (x (raise (condition
> +               (&message
> +                (message (format #f "channel dependency has an invalid\
> + introduction field")))
> +               (&error-location
> +                (location
> +                 (source-properties->location
> +                  (source-properties x)))))))))

I guess the string needs to use ’(G_ )’ for translation, no?


Cheers,
simon




Reply sent to Josselin Poiret <dev <at> jpoiret.xyz>:
You have taken responsibility. (Sun, 04 Jun 2023 09:40:03 GMT) Full text and rfc822 format available.

Notification sent to Josselin Poiret <dev <at> jpoiret.xyz>:
bug acknowledged by developer. (Sun, 04 Jun 2023 09:40:03 GMT) Full text and rfc822 format available.

Message #19 received at 61977-done <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: 61977-done <at> debbugs.gnu.org
Subject: Re: [PATCH] channels: Raise an error if dependency's introduction
 is malformed
Date: Sun, 04 Jun 2023 11:38:55 +0200
[Message part 1 (text/plain, inline)]
Hi everyone,

Josselin Poiret <dev <at> jpoiret.xyz> writes:

> * guix/channels.scm (sexp->channel-introduction): Do it.

Pushed as cacc0cb6ab22218a3783a51ba9986405ede4e0d8, with Simon's
suggestion of adding G_.

Best,
-- 
Josselin Poiret
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 02 Jul 2023 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.