GNU bug report logs - #51091
[PATCH] guix: opam: Do not fail when refreshing.

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Fri, 8 Oct 2021 03:04:01 UTC

Severity: normal

Tags: patch

Done: Julien Lepiller <julien <at> lepiller.eu>

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 51091 in the body.
You can then email your comments to 51091 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#51091; Package guix-patches. (Fri, 08 Oct 2021 03:04:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julien Lepiller <julien <at> lepiller.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 08 Oct 2021 03:04:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: guix-patches <at> gnu.org
Subject: [PATCH] guix: opam: Do not fail when refreshing.
Date: Fri, 8 Oct 2021 05:03:10 +0200
[Message part 1 (text/plain, inline)]
Hi Guix!

the attached patch prevents early failures in "guix refresh -t opam".
It will now simply continue when it encounters a package that is not in
the opam repository.
[0001-guix-opam-Do-not-fail-when-refreshing.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#51091; Package guix-patches. (Sat, 09 Oct 2021 09:40:02 GMT) Full text and rfc822 format available.

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

From: Xinglu Chen <public <at> yoctocell.xyz>
To: Julien Lepiller <julien <at> lepiller.eu>, 51091 <at> debbugs.gnu.org
Subject: Re: [bug#51091] [PATCH] guix: opam: Do not fail when refreshing.
Date: Sat, 09 Oct 2021 11:39:23 +0200
[Message part 1 (text/plain, inline)]
On Fri, Oct 08 2021, Julien Lepiller wrote:

> Hi Guix!
>
> the attached patch prevents early failures in "guix refresh -t opam".
> It will now simply continue when it encounters a package that is not in
> the opam repository.
> From f6260b762dd78772e0d90d96dd92d22346a09007 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien <at> lepiller.eu>
> Date: Fri, 8 Oct 2021 04:58:27 +0200
> Subject: [PATCH] guix: opam: Do not fail when refreshing.
>
> Because we throw an error when a package is not in the opam repository,
> the updater would crash when encountering a package that is not in opam
> but uses the ocaml-build-system, such as opam itself.  This catches the
> error and continues without updating said package, and lets us update
> the rest of the packages.
>
> * guix/import/opam.scm (latest-release): Catch errors and do not crash.
> ---
>  guix/import/opam.scm | 23 +++++++++++++----------
>  1 file changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/guix/import/opam.scm b/guix/import/opam.scm
> index fe13d29f03..8ff1a3ae63 100644
> --- a/guix/import/opam.scm
> +++ b/guix/import/opam.scm
> @@ -409,16 +409,19 @@ package in OPAM."
>  
>  (define (latest-release package)
>    "Return an <upstream-source> for the latest release of PACKAGE."
> -  (and-let* ((opam-name (guix-package->opam-name package))
> -             (opam-file (opam-fetch opam-name))
> -             (version (assoc-ref opam-file "version"))
> -             (opam-content (assoc-ref opam-file "metadata"))
> -             (url-dict (metadata-ref opam-content "url"))
> -             (source-url (metadata-ref url-dict "src")))
> -    (upstream-source
> -      (package (package-name package))
> -      (version version)
> -      (urls (list source-url)))))
> +  (catch #t

Using (catch #t ...) is generally not a good idea.  Maybe ‘opam-fetch’ should
raise a ‘opam-fetch’ condition, and then we would only catch those
conditions?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#51091; Package guix-patches. (Thu, 14 Oct 2021 13:02:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Xinglu Chen <public <at> yoctocell.xyz>
Cc: Julien Lepiller <julien <at> lepiller.eu>, 51091 <at> debbugs.gnu.org
Subject: Re: bug#51091: [PATCH] guix: opam: Do not fail when refreshing.
Date: Thu, 14 Oct 2021 15:01:18 +0200
Hi,

Xinglu Chen <public <at> yoctocell.xyz> skribis:

> On Fri, Oct 08 2021, Julien Lepiller wrote:

[...]

>> Because we throw an error when a package is not in the opam repository,
>> the updater would crash when encountering a package that is not in opam
>> but uses the ocaml-build-system, such as opam itself.  This catches the
>> error and continues without updating said package, and lets us update
>> the rest of the packages.
>>
>> * guix/import/opam.scm (latest-release): Catch errors and do not crash.
>> ---
>>  guix/import/opam.scm | 23 +++++++++++++----------
>>  1 file changed, 13 insertions(+), 10 deletions(-)
>>
>> diff --git a/guix/import/opam.scm b/guix/import/opam.scm
>> index fe13d29f03..8ff1a3ae63 100644
>> --- a/guix/import/opam.scm
>> +++ b/guix/import/opam.scm
>> @@ -409,16 +409,19 @@ package in OPAM."
>>  
>>  (define (latest-release package)
>>    "Return an <upstream-source> for the latest release of PACKAGE."
>> -  (and-let* ((opam-name (guix-package->opam-name package))
>> -             (opam-file (opam-fetch opam-name))
>> -             (version (assoc-ref opam-file "version"))
>> -             (opam-content (assoc-ref opam-file "metadata"))
>> -             (url-dict (metadata-ref opam-content "url"))
>> -             (source-url (metadata-ref url-dict "src")))
>> -    (upstream-source
>> -      (package (package-name package))
>> -      (version version)
>> -      (urls (list source-url)))))
>> +  (catch #t
>
> Using (catch #t ...) is generally not a good idea.  Maybe ‘opam-fetch’ should
> raise a ‘opam-fetch’ condition, and then we would only catch those
> conditions?

Agreed, it’s best to catch the most specific exception, around the most
narrow bits of code, so unexpected errors that denote bugs are properly
reported.

Nitpick: in the commit log, the subject line should start with
“import: opam:”.  :-)

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#51091; Package guix-patches. (Sat, 16 Oct 2021 02:11:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 51091 <at> debbugs.gnu.org, Xinglu Chen <public <at> yoctocell.xyz>
Subject: Re: bug#51091: [PATCH v2] guix: opam: Do not fail when refreshing.
Date: Sat, 16 Oct 2021 04:10:09 +0200
[Message part 1 (text/plain, inline)]
Thanks for the reviews! I've managed to use conditions, which was not
easy because I didn't notice there was already a "condition" defined,
and that lead to weird error messages. Attached is the updated patch.
[0001-import-opam-Do-not-fail-when-refreshing.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#51091; Package guix-patches. (Mon, 18 Oct 2021 08:40:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 51091 <at> debbugs.gnu.org, Xinglu Chen <public <at> yoctocell.xyz>
Subject: Re: bug#51091: [PATCH v2] guix: opam: Do not fail when refreshing.
Date: Mon, 18 Oct 2021 10:39:04 +0200
Hi!

Julien Lepiller <julien <at> lepiller.eu> skribis:

> Thanks for the reviews! I've managed to use conditions, which was not
> easy because I didn't notice there was already a "condition" defined,
> and that lead to weird error messages. Attached is the updated patch.

Oh, I see.

> From 0cadac6c3dabea8b986cd59d97c84beaf7a33325 Mon Sep 17 00:00:00 2001
> Message-Id: <0cadac6c3dabea8b986cd59d97c84beaf7a33325.1634350078.git.julien <at> lepiller.eu>
> From: Julien Lepiller <julien <at> lepiller.eu>
> Date: Fri, 8 Oct 2021 04:58:27 +0200
> Subject: [PATCH] import: opam: Do not fail when refreshing.
>
> Because we throw an error when a package is not in the opam repository,
> the updater would crash when encountering a package that is not in opam
> but uses the ocaml-build-system, such as opam itself.  This catches the
> error and continues without updating said package, and lets us update
> the rest of the packages.
>
> * guix/scripts/import/opam.scm (guix-import-opam): Catch not-found
> condition and leave.
> * guix/import/opam.scm (&opam-not-found-error): New condition type.
> (opam-fetch): Raise condition instead of leaving.
> (latest-release): Catch not-found condition and warn.
> (conditional): Rename from `condition'.
> * tests/opam.scm (parse-conditions): Change accordingly.

LGTM, thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#51091; Package guix-patches. (Fri, 19 Nov 2021 01:17:01 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 51091 <at> debbugs.gnu.org, Xinglu Chen <public <at> yoctocell.xyz>
Subject: Re: bug#51091: [PATCH v3] guix: opam: Do not fail when refreshing.
Date: Fri, 19 Nov 2021 02:16:46 +0100
[Message part 1 (text/plain, inline)]
Le Mon, 18 Oct 2021 10:39:04 +0200,
Ludovic Courtès <ludo <at> gnu.org> a écrit :

> Hi!
> 
> Julien Lepiller <julien <at> lepiller.eu> skribis:
> 
> > Thanks for the reviews! I've managed to use conditions, which was
> > not easy because I didn't notice there was already a "condition"
> > defined, and that lead to weird error messages. Attached is the
> > updated patch.  
> 
> Oh, I see.
> 
> > From 0cadac6c3dabea8b986cd59d97c84beaf7a33325 Mon Sep 17 00:00:00
> > 2001 Message-Id:
> > <0cadac6c3dabea8b986cd59d97c84beaf7a33325.1634350078.git.julien <at> lepiller.eu>
> > From: Julien Lepiller <julien <at> lepiller.eu> Date: Fri, 8 Oct 2021
> > 04:58:27 +0200 Subject: [PATCH] import: opam: Do not fail when
> > refreshing.
> >
> > Because we throw an error when a package is not in the opam
> > repository, the updater would crash when encountering a package
> > that is not in opam but uses the ocaml-build-system, such as opam
> > itself.  This catches the error and continues without updating said
> > package, and lets us update the rest of the packages.
> >
> > * guix/scripts/import/opam.scm (guix-import-opam): Catch not-found
> > condition and leave.
> > * guix/import/opam.scm (&opam-not-found-error): New condition type.
> > (opam-fetch): Raise condition instead of leaving.
> > (latest-release): Catch not-found condition and warn.
> > (conditional): Rename from `condition'.
> > * tests/opam.scm (parse-conditions): Change accordingly.  
> 
> LGTM, thanks!
> 
> Ludo’.

I forgot to remove the catch #t around the whole body of the function.
I noticed that guard* was raising &non-continuable so I tried to fix it
by using raise-continuable from (ice-9 exceptions). Is this the correct
solution?
[0001-import-opam-Do-not-fail-when-refreshing.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#51091; Package guix-patches. (Fri, 19 Nov 2021 01:44:02 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 51091 <at> debbugs.gnu.org,
 Xinglu Chen <public <at> yoctocell.xyz>
Subject: Re: [bug#51091] [PATCH v3] guix: opam: Do not fail when refreshing.
Date: Fri, 19 Nov 2021 02:43:01 +0100
Hi,

On Fri, 19 Nov 2021 at 02:17, Julien Lepiller <julien <at> lepiller.eu> wrote:

> I forgot to remove the catch #t around the whole body of the function.
> I noticed that guard* was raising &non-continuable so I tried to fix it
> by using raise-continuable from (ice-9 exceptions). Is this the correct
> solution?

I think <http://issues.guix.gnu.org/51888> is simpler and fix the same thing.


Cheers,
simon




Information forwarded to guix-patches <at> gnu.org:
bug#51091; Package guix-patches. (Fri, 19 Nov 2021 09:17:03 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 51091 <at> debbugs.gnu.org, Xinglu Chen <public <at> yoctocell.xyz>
Subject: Re: bug#51091: [PATCH v3] guix: opam: Do not fail when refreshing.
Date: Fri, 19 Nov 2021 10:16:32 +0100
Hi,

Julien Lepiller <julien <at> lepiller.eu> skribis:

> I forgot to remove the catch #t around the whole body of the function.
> I noticed that guard* was raising &non-continuable so I tried to fix it
> by using raise-continuable from (ice-9 exceptions). Is this the correct
> solution?

I suppose, though I’m not sure why it needs to be continuable: you could
just catch the exception and move on to the next package?

> From a60e2ca645f4f8a6da72111d047f8cbb41ebe3e6 Mon Sep 17 00:00:00 2001
> Message-Id: <a60e2ca645f4f8a6da72111d047f8cbb41ebe3e6.1637284512.git.julien <at> lepiller.eu>
> From: Julien Lepiller <julien <at> lepiller.eu>
> Date: Fri, 8 Oct 2021 04:58:27 +0200
> Subject: [PATCH] import: opam: Do not fail when refreshing.
>
> Because we throw an error when a package is not in the opam repository,
> the updater would crash when encountering a package that is not in opam
> but uses the ocaml-build-system, such as opam itself.  This catches the
> error and continues without updating said package, and lets us update
> the rest of the packages.
>
> * guix/scripts/import/opam.scm (guix-import-opam): Catch not-found
> condition and leave.
> * guix/import/opam.scm (&opam-not-found-error): New condition type.
> (opam-fetch): Raise condition instead of leaving.
> (latest-release): Catch not-found condition and warn.
> (conditional): Rename from `condition'.
> * tests/opam.scm (parse-conditions): Change accordingly.

[...]

zimoun <zimon.toutoune <at> gmail.com> skribis:

> I think <http://issues.guix.gnu.org/51888> is simpler and fix the same thing.

I’m fine either way.  I think there’s value longer-term in having
structured exceptions in importers, though.

Julien: your call!

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#51091; Package guix-patches. (Fri, 19 Nov 2021 09:41:02 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Julien Lepiller <julien <at> lepiller.eu>, 51091 <at> debbugs.gnu.org,
 Xinglu Chen <public <at> yoctocell.xyz>
Subject: Re: [bug#51091] [PATCH v3] guix: opam: Do not fail when refreshing.
Date: Fri, 19 Nov 2021 10:40:11 +0100
Hi Ludo and Julien,

On Fri, 19 Nov 2021 at 10:17, Ludovic Courtès <ludo <at> gnu.org> wrote:

> I’m fine either way.  I think there’s value longer-term in having
> structured exceptions in importers, though.

Yes, I agree.  For instance, as discussed after this old quick fix
[1].  Then I did some pair programming with jeko to have a v2.  The
idea is to have a common exception mechanism for all the importers.
Instead of case per case and scattered implementation through various
importers (proposed patch for opam, another example
guix/import/elpa.scm using &message etc.).  All the importers should
share the same interface for handling exceptions and errors.  Well, it
has never seen the light because time flies so fast and because at one
point, one needs to sit down and unknot all; personally, I have been a
bit lazy for completing the task. :-)

1: <http://issues.guix.gnu.org/issue/45984#9>

> Julien: your call!

I agree, as mentioned [2]. :-)

2: <http://issues.guix.gnu.org/issue/51888#3>


Cheers,
simon




Information forwarded to guix-patches <at> gnu.org:
bug#51091; Package guix-patches. (Fri, 19 Nov 2021 11:21:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 51091 <at> debbugs.gnu.org, Xinglu Chen <public <at> yoctocell.xyz>
Subject: Re: bug#51091: [PATCH v3] guix: opam: Do not fail when refreshing.
Date: Fri, 19 Nov 2021 06:19:56 -0500

Le 19 novembre 2021 04:16:32 GMT-05:00, "Ludovic Courtès" <ludo <at> gnu.org> a écrit :
>Hi,
>
>Julien Lepiller <julien <at> lepiller.eu> skribis:
>
>> I forgot to remove the catch #t around the whole body of the function.
>> I noticed that guard* was raising &non-continuable so I tried to fix it
>> by using raise-continuable from (ice-9 exceptions). Is this the correct
>> solution?
>
>I suppose, though I’m not sure why it needs to be continuable: you could
>just catch the exception and move on to the next package?

I don't understand how to catch the exception though, unless you mean wrap everything with catch #t, which kinda defeats the purpose of having a condition in the first pjace. guard* raises &non-continuable unless the condition is continuable, or I'm missing something in the way I use it. I have no idea what a continuable exception is, so let me just push the other patch.

(guard* (c ((opam-error? c) #f)))
  (raise (condition (&opam-error …))))

Doesn't return #f as I expect, but raises &non-continuable.

>
>> From a60e2ca645f4f8a6da72111d047f8cbb41ebe3e6 Mon Sep 17 00:00:00 2001
>> Message-Id: <a60e2ca645f4f8a6da72111d047f8cbb41ebe3e6.1637284512.git.julien <at> lepiller.eu>
>> From: Julien Lepiller <julien <at> lepiller.eu>
>> Date: Fri, 8 Oct 2021 04:58:27 +0200
>> Subject: [PATCH] import: opam: Do not fail when refreshing.
>>
>> Because we throw an error when a package is not in the opam repository,
>> the updater would crash when encountering a package that is not in opam
>> but uses the ocaml-build-system, such as opam itself.  This catches the
>> error and continues without updating said package, and lets us update
>> the rest of the packages.
>>
>> * guix/scripts/import/opam.scm (guix-import-opam): Catch not-found
>> condition and leave.
>> * guix/import/opam.scm (&opam-not-found-error): New condition type.
>> (opam-fetch): Raise condition instead of leaving.
>> (latest-release): Catch not-found condition and warn.
>> (conditional): Rename from `condition'.
>> * tests/opam.scm (parse-conditions): Change accordingly.
>
>[...]
>
>zimoun <zimon.toutoune <at> gmail.com> skribis:
>
>> I think <http://issues.guix.gnu.org/51888> is simpler and fix the same thing.
>
>I’m fine either way.  I think there’s value longer-term in having
>structured exceptions in importers, though.
>
>Julien: your call!

Hopefully someone smarter than me can figure it out. I'll push the other patch, although I don't like the double warning in the updater.

>
>Thanks,
>Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#51091; Package guix-patches. (Fri, 19 Nov 2021 11:31:02 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 51091 <at> debbugs.gnu.org,
 Xinglu Chen <public <at> yoctocell.xyz>
Subject: Re: [bug#51091] [PATCH v3] guix: opam: Do not fail when refreshing.
Date: Fri, 19 Nov 2021 12:30:20 +0100
Hi Julien,

On Fri, 19 Nov 2021 at 12:21, Julien Lepiller <julien <at> lepiller.eu> wrote:

> >> I forgot to remove the catch #t around the whole body of the function.
> >> I noticed that guard* was raising &non-continuable so I tried to fix it
> >> by using raise-continuable from (ice-9 exceptions). Is this the correct
> >> solution?
> >
> >I suppose, though I’m not sure why it needs to be continuable: you could
> >just catch the exception and move on to the next package?
>
> I don't understand how to catch the exception though, unless you mean wrap everything with catch #t, which kinda defeats the purpose of having a condition in the first pjace. guard* raises &non-continuable unless the condition is continuable, or I'm missing something in the way I use it. I have no idea what a continuable exception is, so let me just push the other patch.
>
> (guard* (c ((opam-error? c) #f)))
>   (raise (condition (&opam-error …))))
>
> Doesn't return #f as I expect, but raises &non-continuable.

I sympathize and I had / is still having hard time with similar use
cases.  That's one of the reasons (among my laziness :-)) that [1] is
not fixed yet. :-)

1: <1: <http://issues.guix.gnu.org/issue/45984>



> Hopefully someone smarter than me can figure it out. I'll push the other patch, although I don't like the double warning in the updater.

I agree.  And move all G_ strings to guix/scripts/ is a good idea, IMHO.
Well, I do not know. :-)

(I secretly hoped that you would be the smarter than me person fixing
the recursive importers. ;-))


Cheers,
simon




Reply sent to Julien Lepiller <julien <at> lepiller.eu>:
You have taken responsibility. (Fri, 19 Nov 2021 19:50:01 GMT) Full text and rfc822 format available.

Notification sent to Julien Lepiller <julien <at> lepiller.eu>:
bug acknowledged by developer. (Fri, 19 Nov 2021 19:50:02 GMT) Full text and rfc822 format available.

Message #40 received at 51091-close <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: 51091-close <at> debbugs.gnu.org
Subject: Re: [bug#51091] [PATCH v3] guix: opam: Do not fail when refreshing.
Date: Fri, 19 Nov 2021 14:49:02 -0500
[Message part 1 (text/plain, inline)]
Forgot to send to the address that actually closes the issue ^^"



-------- Courriel d’origine --------
De : Julien Lepiller <julien <at> lepiller.eu>
Envoyé : 19 novembre 2021 13:13:08 GMT-05:00
À : zimoun <zimon.toutoune <at> gmail.com>
Cc : "Ludovic Courtès" <ludo <at> gnu.org>, Xinglu Chen <public <at> yoctocell.xyz>
Objet : Re: [bug#51091] [PATCH v3] guix: opam: Do not fail when refreshing.

So, since I pushed Zimoun's patch, I'm closing this one. I received some help on IRC this morning so I should be able to come up with something more generic for all importers at some point. Zimoun if you want to work on that, I'd be happy to collaborate :)

Le 19 novembre 2021 06:30:20 GMT-05:00, zimoun <zimon.toutoune <at> gmail.com> a écrit :
>Hi Julien,
>
>On Fri, 19 Nov 2021 at 12:21, Julien Lepiller <julien <at> lepiller.eu> wrote:
>
>> >> I forgot to remove the catch #t around the whole body of the function.
>> >> I noticed that guard* was raising &non-continuable so I tried to fix it
>> >> by using raise-continuable from (ice-9 exceptions). Is this the correct
>> >> solution?
>> >
>> >I suppose, though I’m not sure why it needs to be continuable: you could
>> >just catch the exception and move on to the next package?
>>
>> I don't understand how to catch the exception though, unless you mean wrap everything with catch #t, which kinda defeats the purpose of having a condition in the first pjace. guard* raises &non-continuable unless the condition is continuable, or I'm missing something in the way I use it. I have no idea what a continuable exception is, so let me just push the other patch.
>>
>> (guard* (c ((opam-error? c) #f)))
>>   (raise (condition (&opam-error …))))
>>
>> Doesn't return #f as I expect, but raises &non-continuable.
>
>I sympathize and I had / is still having hard time with similar use
>cases.  That's one of the reasons (among my laziness :-)) that [1] is
>not fixed yet. :-)
>
>1: <1: <http://issues.guix.gnu.org/issue/45984>
>
>
>
>> Hopefully someone smarter than me can figure it out. I'll push the other patch, although I don't like the double warning in the updater.
>
>I agree.  And move all G_ strings to guix/scripts/ is a good idea, IMHO.
>Well, I do not know. :-)
>
>(I secretly hoped that you would be the smarter than me person fixing
>the recursive importers. ;-))
>
>
>Cheers,
>simon
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 18 Dec 2021 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 91 days ago.

Previous Next


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