From: Christopher Baines <mail@cbaines.net>
To: Mark H Weaver <mhw@netris.org>
Cc: guix-devel@gnu.org
Subject: Re: 02/02: import: cpan: Adapt for the change to guile-json version 3.
Date: Thu, 22 Aug 2019 08:41:11 +0100 [thread overview]
Message-ID: <874l298x60.fsf@cbaines.net> (raw)
In-Reply-To: <874l2a470l.fsf@netris.org>
[-- Attachment #1: Type: text/plain, Size: 2682 bytes --]
Mark H Weaver <mhw@netris.org> writes:
> Hi Christopher,
>
> guix-commits@gnu.org writes:
>
>> cbaines pushed a commit to branch master
>> in repository guix.
>>
>> commit 01ce7af25add55514f737af48ea6c127bedfde67
>> Author: Christopher Baines <mail@cbaines.net>
>> Date: Tue Aug 6 20:17:28 2019 +0100
>>
>> import: cpan: Adapt for the change to guile-json version 3.
>>
>> In guile-json version 3, JSON objects are represented as hash tables, rather
>> than alists.
>
> I haven't looked carefully, but I thought it was the other way around.
> Quoting from the guile-json 3.0.0 release announcement:
>
> "JSON objects are now defined as alists (instead of hash tables) and
> JSON arrays are now defined as vectors (instead of lists)."
>
> <https://savannah.nongnu.org/forum/forum.php?forum_id=9340>
>
> With this in mind, I'm surprised to see additional uses of hash tables
> here. It would be good to avoid hash tables except in cases where
> efficiency demands it.
>
>> * guix/import/cpan.scm (string->license): Change the match expression to match
>> on lists, rather than vectors.
>> (module->dist-name, cpan-source-url, cpan-version): Change assoc-ref to
>> hash-ref.
>> (cpan-module->sexp): Change assoc-ref to hash-ref, and assoc-ref* to
>> hash-ref*.
>> * tests/cpan.scm ("source-url-http", "source-url-https"): Convert the alist to
>> a hash table.
>
> Can you help me understand why the apparent switch _away_ from hash
> tables in Guile-JSON-3 has somehow led to increased usage of hash tables
> in this commit, as well as the addition of 'hash-ref*' in the exports of
> (guix import utils)?
I think the answer is somehow I'm still using an earlier version of
Guile JSON.
→ ./pre-inst-env guile -c '(begin (use-modules (json)) (display (json-string->scm "{\"foo\": 1}")))'
#<hash-table b3dd40 1/31>
When I run configure, that seems happy with the version of Guile JSON.
checking whether Guile-JSON is available and recent enough... yes
However, I'm running ./configure in guix environment guix, and yeah,
that seems to provide a different version of guile-json to the one that
I apparently have implicitly in my profile.
So maybe it's not enough to run ./pre-inst-env, I need to do that within
guix environment guix to make it more likely that I get a profile that
works...
Back to these changes though, all I wanted to do was to fix the
importer, but if the problem is with my environment not the Guix code,
then these changes probably need reverting (as they'll break the
importer who's not got a similarly broken local setup).
Chris
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]
next prev parent reply other threads:[~2019-08-22 7:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190821172955.31209.69550@vcs0.savannah.gnu.org>
[not found] ` <20190821172956.6533A20E34@vcs0.savannah.gnu.org>
2019-08-21 20:06 ` 02/02: import: cpan: Adapt for the change to guile-json version 3 Mark H Weaver
2019-08-22 7:41 ` Christopher Baines [this message]
2019-08-22 7:59 ` Ricardo Wurmus
2019-08-22 18:32 ` Mark H Weaver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874l298x60.fsf@cbaines.net \
--to=mail@cbaines.net \
--cc=guix-devel@gnu.org \
--cc=mhw@netris.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.