"guix import opam coq-of-ocaml" unexpected error

  • Done
  • quality assurance status badge
Details
3 participants
  • Julien Lepiller
  • raingloom
  • zimoun
Owner
unassigned
Submitted by
zimoun
Severity
normal
Z
Z
zimoun wrote on 10 Jan 2022 18:01
(address . bug-guix@gnu.org)
87wnj7wmmd.fsf@gmail.com
Hi,

For some reasons, the Opam importer is failing for coq-of-ocaml:

Toggle snippet (30 lines)
$ guix import opam coq-of-ocaml

Starting download of /tmp/guix-file.058Nel
From https://github.com/clarus/coq-of-ocaml/releases/download/2.5.1/coq-of-ocaml-full.2.5.1.tar.gz...
following redirection to `https://github.com/foobar-land/coq-of-ocaml/releases/download/2.5.1/coq-of-ocaml-full.2.5.1.tar.gz'...
following redirection to `https://objects.githubusercontent.com/github-production-release-asset-2e65be/14023027/b17b0f80-d4ea-11eb-8861-d8d0c56a130f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220110T165945Z&X-Amz-Expires=300&X-Amz-Signature=7422a35182a4ae9cf511471dca445a65316a70e8baa7ffefc9381ce3588002da&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=14023027&response-content-disposition=attachment%3B%20filename%3Dcoq-of-ocaml-full.2.5.1.tar.gz&response-content-type=application%2Foctet-stream'...
…ll.2.5.1.tar.gz 2.3MiB 44.3MiB/s 00:00 [##################] 100.0%
Backtrace:
8 (primitive-load "/home/simon/.config/guix/current/bin/guix")
In guix/ui.scm:
2206:7 7 (run-guix . _)
2169:10 6 (run-guix-command _ . _)
In guix/scripts/import.scm:
124:11 5 (guix-import . _)
In guix/scripts/import/opam.scm:
105:23 4 (guix-import-opam . _)
In guix/build/utils.scm:
251:8 3 (call-with-temporary-output-file #<procedure 7ff70d73d500 at guix/import/opam.scm:348:12 (temp port)>)
In guix/import/opam.scm:
374:37 2 (_ _ _)
In guix/import/utils.scm:
244:19 1 (beautify-description #f _)
In unknown file:
0 (string-prefix? "A " #f #<undefined> #<undefined> #<undefined> #<undefined>)

ERROR: In procedure string-prefix?:
In procedure string-prefix?: Wrong type argument in position 2 (expecting string): #f


Cheers,
simon
R
R
raingloom wrote on 10 Jan 2022 21:36
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 53165@debbugs.gnu.org)
20220110213657.36b9869d@riseup.net
On Mon, 10 Jan 2022 18:01:46 +0100
zimoun <zimon.toutoune@gmail.com> wrote:

Toggle quote (43 lines)
> Hi,
>
> For some reasons, the Opam importer is failing for coq-of-ocaml:
>
> --8<---------------cut here---------------start------------->8---
> $ guix import opam coq-of-ocaml
>
> Starting download of /tmp/guix-file.058Nel
> From
> https://github.com/clarus/coq-of-ocaml/releases/download/2.5.1/coq-of-ocaml-full.2.5.1.tar.gz...
> following redirection to
> `https://github.com/foobar-land/coq-of-ocaml/releases/download/2.5.1/coq-of-ocaml-full.2.5.1.tar.gz'...
> following redirection to
> `https://objects.githubusercontent.com/github-production-release-asset-2e65be/14023027/b17b0f80-d4ea-11eb-8861-d8d0c56a130f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220110T165945Z&X-Amz-Expires=300&X-Amz-Signature=7422a35182a4ae9cf511471dca445a65316a70e8baa7ffefc9381ce3588002da&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=14023027&response-content-disposition=attachment%3B%20filename%3Dcoq-of-ocaml-full.2.5.1.tar.gz&response-content-type=application%2Foctet-stream'...
> …ll.2.5.1.tar.gz 2.3MiB 44.3MiB/s 00:00
> [##################] 100.0% Backtrace: 8 (primitive-load
> "/home/simon/.config/guix/current/bin/guix") In guix/ui.scm: 2206:7
> 7 (run-guix . _) 2169:10 6 (run-guix-command _ . _) In
> guix/scripts/import.scm: 124:11 5 (guix-import . _)
> In guix/scripts/import/opam.scm:
> 105:23 4 (guix-import-opam . _)
> In guix/build/utils.scm:
> 251:8 3 (call-with-temporary-output-file #<procedure
> 7ff70d73d500 at guix/import/opam.scm:348:12 (temp port)>) In
> guix/import/opam.scm: 374:37 2 (_ _ _)
> In guix/import/utils.scm:
> 244:19 1 (beautify-description #f _)
> In unknown file:
> 0 (string-prefix? "A " #f #<undefined> #<undefined>
> #<undefined> #<undefined>)
>
> ERROR: In procedure string-prefix?:
> In procedure string-prefix?: Wrong type argument in position 2
> (expecting string): #f --8<---------------cut
> here---------------end--------------->8---
>
>
> Cheers,
> simon
>
>
>

My guess is that the package is missing a description? I vaguely recall
running into this or a similar error when trying to import Infer, but
I'm not sure how I fixed it.
Based on the backtrace, just modifying beautify-description? to act as
the identity function when the input isn't a string should be enough.

ps.:
This is why Scheme should have a Maybe type instead of this mess of
overloading boolean false. :)
Or at least Guile should have an optional type checker like MyPy.
Z
Z
zimoun wrote on 11 Jan 2022 11:51
(name . raingloom)(address . raingloom@riseup.net)(address . 53165@debbugs.gnu.org)
86h7aa4kag.fsf@gmail.com
Hi,

On Mon, 10 Jan 2022 at 21:36, raingloom <raingloom@riseup.net> wrote:

Toggle quote (6 lines)
> My guess is that the package is missing a description? I vaguely recall
> running into this or a similar error when trying to import Infer, but
> I'm not sure how I fixed it.
> Based on the backtrace, just modifying beautify-description? to act as
> the identity function when the input isn't a string should be enough.

Thanks. If no one beats me, I will give a look. But for now it is low
in my list. :-)


Toggle quote (4 lines)
> This is why Scheme should have a Maybe type instead of this mess of
> overloading boolean false. :)
> Or at least Guile should have an optional type checker like MyPy.

Hm, I do not think Maybe would change something if the «package is
missing a description». At best, Maybe would be another way to catch
the errors instead of raising the Backtrace, no?

And I do not think that a type checker like MyPy would raises something
here if the issue comes from the missing upstream description, no?

Something like QuickCheck seems required and would raise the bug,
eventually. Oh wait, guile-quickcheck is around [1] and used by
Disarchive; therefore already an indirect dependency of guix. :-)

That’s said, nothing prevents Guile to have a Maybe monad. But I think
this way of programming is not popular among Schemers. :-) And I agree
that a type checker would prevent many issues. Even, I remember talking
this topic back on December 2018 around this event:


Cheers,
simon


J
J
Julien Lepiller wrote on 12 Jun 2022 07:15
(name . zimoun)(address . zimon.toutoune@gmail.com)
20220612071538.4f8f869c@sybil.lepiller.eu
Since then, this has been fixed:

guix import opam coq-of-ocaml
...
(description
"This package lacks a description. Run \"info '(guix) Synopses and
Descriptions'\" for more information.")
...

So, closing :)
Closed
?