OPAM importer fails in lookup-node

  • Open
  • quality assurance status badge
Details
3 participants
  • Julien Lepiller
  • Csepp
  • zimoun
Owner
unassigned
Submitted by
Csepp
Severity
normal
C
(name . Bug reports for GNU Guix)(address . bug-guix@gnu.org)(address . julien@lepiller.eu)
87sfkd11eh.fsf@riseup.net
The specific error is this:
Wrong number of values returned to continuation (expected 2)
It is caused by opam->guix-package silencing intermediate errors by
using and-let* (the poor person's Maybe monad) and returning #f when the
receiving side expects two return values.

Initial reproducer:
guix import opam -r mirage

Also happens with opam-monorepo.

Cc-ing Julien whom might know why the code is structured this way? It's
not like the calling side can handle a falsy return and the error is not
detected early either, so the user doesn't even know what is causing it.
Can I just turn it all into errors? Or maybe we can use the condition
system?
J
J
Julien Lepiller wrote on 27 Sep 2022 17:42
DEAED6AB-EDFF-4A83-9435-90FA9E6A6C35@lepiller.eu
It's probably because other importers are structured that way. I'd be in favor of changing that and using the condition system.

Le 27 septembre 2022 13:33:56 GMT+02:00, Csepp <raingloom@riseup.net> a écrit :
Toggle quote (17 lines)
>The specific error is this:
>Wrong number of values returned to continuation (expected 2)
>It is caused by opam->guix-package silencing intermediate errors by
>using and-let* (the poor person's Maybe monad) and returning #f when the
>receiving side expects two return values.
>
>Initial reproducer:
>guix import opam -r mirage
>
>Also happens with opam-monorepo.
>
>Cc-ing Julien whom might know why the code is structured this way? It's
>not like the calling side can handle a falsy return and the error is not
>detected early either, so the user doesn't even know what is causing it.
>Can I just turn it all into errors? Or maybe we can use the condition
>system?
>
Attachment: file
Z
Z
zimoun wrote on 27 Sep 2022 15:47
Re: bug#58112: OPAM importer fails in lookup-node
(address . julien@lepiller.eu)
86mtaludwy.fsf@gmail.com
Hi,

On Tue, 27 Sep 2022 at 13:33, Csepp <raingloom@riseup.net> wrote:
Toggle quote (9 lines)
> The specific error is this:
> Wrong number of values returned to continuation (expected 2)
> It is caused by opam->guix-package silencing intermediate errors by
> using and-let* (the poor person's Maybe monad) and returning #f when the
> receiving side expects two return values.
>
> Initial reproducer:
> guix import opam -r mirage

I have not checked for opam, but it reminds me fixes in other importers.

5278cab3dc * scripts: import: gem: Fix recursive error handling.
7229b0e858 * import: cran: Return multiple values for unknown packages.
1fe81b349c * import: elpa: Return multiple values for unknown packages.
6bb92098b4 * import: hackage: Return multiple values for unknown packages.

And the bug#44115 report [1] mentioned opam but indeed the fix probably
fell in the crack. :-)

Do you want to give a try?





Cheers,
simon
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 58112@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 58112
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch