GNU bug report logs - #45453
Error when I try to build a package using a JSON definition

Previous Next

Package: guix;

Reported by: Ryan Prior <rprior <at> protonmail.com>

Date: Sun, 27 Dec 2020 00:39:02 UTC

Severity: normal

Done: Ricardo Wurmus <rekado <at> elephly.net>

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 45453 in the body.
You can then email your comments to 45453 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 bug-guix <at> gnu.org:
bug#45453; Package guix. (Sun, 27 Dec 2020 00:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ryan Prior <rprior <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 27 Dec 2020 00:39:02 GMT) Full text and rfc822 format available.

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

From: Ryan Prior <rprior <at> protonmail.com>
To: bug-guix <at> gnu.org
Cc: Ricardo Wurmus <rekado <at> elephly.net>
Subject: Error when I try to build a package using a JSON definition
Date: Sun, 27 Dec 2020 00:38:18 +0000
[Message part 1 (text/plain, inline)]
Hi guix! Today I wrote a package in Guile and then decided to try and
reproduce the same thing using JSON, but I hit a snag. I'm attaching
the package definition in its Guile and JSON forms, along with the error
I get when I try to build the package using `guix build -f countdown.json'.

Any idea what the issue here is or how I should go about debugging?

Thank you!
Ryan

[countdown.scm (application/octet-stream, attachment)]
[countdown.json (application/json, attachment)]
[countdown-build.out.txt (text/plain, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#45453; Package guix. (Sun, 27 Dec 2020 02:29:01 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: Ryan Prior <rprior <at> protonmail.com>,45453 <at> debbugs.gnu.org
Subject: Re: bug#45453: Error when I try to build a package using a JSON
 definition
Date: Sat, 26 Dec 2020 21:28:10 -0500
[Message part 1 (text/plain, inline)]
I'm surprised guix builds from a json file… doesn't it simply interpret it as a guile file, and fails at that?

Anyway, in the log you attached, it seems the issue is with downloading the sources. For some reason it cannot resolve the github.com domain. I wonder if this is just a transient network issue on your side? Have you tried again later?

If not, it could be that the source derivation is not fixed-output. After all, the json definition doesn't specify a hash (it's not even an origin record). Again I'm confused by the fact that guix lets you specify packages with json, so I'm not sure how that part is converted to a package object. Is that documented?

Le 26 décembre 2020 19:38:18 GMT-05:00, Ryan Prior via Bug reports for GNU Guix <bug-guix <at> gnu.org> a écrit :
>Hi guix! Today I wrote a package in Guile and then decided to try and
>reproduce the same thing using JSON, but I hit a snag. I'm attaching
>the package definition in its Guile and JSON forms, along with the
>error
>I get when I try to build the package using `guix build -f
>countdown.json'.
>
>Any idea what the issue here is or how I should go about debugging?
>
>Thank you!
>Ryan
[Message part 2 (text/html, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#45453; Package guix. (Sun, 27 Dec 2020 03:21:02 GMT) Full text and rfc822 format available.

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

From: Ryan Prior <rprior <at> protonmail.com>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 45453 <at> debbugs.gnu.org
Subject: Re: bug#45453: Error when I try to build a package using a JSON
 definition
Date: Sun, 27 Dec 2020 03:19:56 +0000
Julien Lepiller <julien <at> lepiller.eu> writes:

> Anyway, in the log you attached, it seems the issue is with downloading the sources. For some reason it cannot
> resolve the github.com domain. I wonder if this is just a transient network issue on your side? Have you tried again
> later?

I did try it twice, some hours apart. And in the meanwhile, the package
defined using Guile downloads its sources and builds just fine.

> If not, it could be that the source derivation is not fixed-output. After all, the json definition doesn't specify a hash
> (it's not even an origin record). Again I'm confused by the fact that guix lets you specify packages with json, so I'm
> not sure how that part is converted to a package object. Is that
> documented?

It is in the manual (Search for "JSON representation"):
https://guix.gnu.org/manual/en/html_node/Invoking-guix-package.html

Not clear to me whether you can provide a source hash as part of a JSON
package definition.

Thanks & let me know if you turn up any other clues!
Ryan





Information forwarded to bug-guix <at> gnu.org:
bug#45453; Package guix. (Sun, 27 Dec 2020 10:39:01 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Ryan Prior <rprior <at> protonmail.com>
Cc: 45453 <at> debbugs.gnu.org
Subject: Re: Error when I try to build a package using a JSON definition
Date: Sun, 27 Dec 2020 11:38:01 +0100
Hi Ryan,

> Any idea what the issue here is or how I should go about debugging?

You were *so* close!  The problem is with the license field.
Uncharacteristically, we are using spdx-string->license here, so “expat”
is not a valid license name.  When you replace it with “MIT” it will
work.

I’ll change this to use the Guixy license names first, and only fall
back to SPDX names when that fails.  And there should be a proper error
message, of course.

Thanks for the bug report!

-- 
Ricardo




Information forwarded to bug-guix <at> gnu.org:
bug#45453; Package guix. (Sun, 27 Dec 2020 10:42:01 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: bug-guix <at> gnu.org, Ryan Prior <rprior <at> protonmail.com>, 45453 <at> debbugs.gnu.org
Subject: Re: bug#45453: Error when I try to build a package using a JSON
 definition
Date: Sun, 27 Dec 2020 11:40:58 +0100
Hey Julien,

> I'm surprised guix builds from a json file…

it’s a little known feature.  I added it a long time ago, half in jest,
half in the realization that this removes a common superficial objection
to Guix.

> If not, it could be that the source derivation is not
> fixed-output. After all, the json definition doesn't specify a hash
> (it's not even an origin record). Again I'm confused by the fact that
> guix lets you specify packages with json, so I'm not sure how that
> part is converted to a package object. Is that documented?

Yes, it’s all documented.  The manual has to indexed locations for
“JSON”.  One of them says that you don’t need to specify an origin
record, but you can if you feel like it:

--8<---------------cut here---------------start------------->8---
     The importer also supports a more explicit source definition using
     the common fields for ‘<origin>’ records:

          {
            ...
            "source": {
              "method": "url-fetch",
              "uri": "mirror://gnu/hello/hello-2.10.tar.gz",
              "sha256": {
                "base32": "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"
              }
            }
            ...
          }
--8<---------------cut here---------------end--------------->8---

-- 
Ricardo




Information forwarded to bug-guix <at> gnu.org:
bug#45453; Package guix. (Sun, 27 Dec 2020 10:42:02 GMT) Full text and rfc822 format available.

Reply sent to Ricardo Wurmus <rekado <at> elephly.net>:
You have taken responsibility. (Sun, 27 Dec 2020 11:09:02 GMT) Full text and rfc822 format available.

Notification sent to Ryan Prior <rprior <at> protonmail.com>:
bug acknowledged by developer. (Sun, 27 Dec 2020 11:09:02 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Ryan Prior <rprior <at> protonmail.com>
Cc: 45453-done <at> debbugs.gnu.org
Subject: Re: Error when I try to build a package using a JSON definition
Date: Sun, 27 Dec 2020 12:08:03 +0100
Ricardo Wurmus <rekado <at> elephly.net> writes:

> I’ll change this to use the Guixy license names first, and only fall
> back to SPDX names when that fails.  And there should be a proper error
> message, of course.

This is now fixed with commit 5aae614868.

-- 
Ricardo




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

This bug report was last modified 3 years and 86 days ago.

Previous Next


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