GNU bug report logs -
#74900
[PATCH] Replace (guix build json) with (json) in node build system
Previous Next
Full log
Message #29 received at 74900 <at> debbugs.gnu.org (full text, mbox):
Hi Daniel,
Daniel Khodabakhsh <d.khodabakhsh <at> gmail.com> skribis:
> This change replaces the use of (guix build json) with (json) for the
> node ecosystem.
> Since guile-json is a dependency of Guix, and it's used elsewhere in
> the project, it makes sense to use this instead of rolling our own
> JSON implementation with (guix build json).
>
> (guix build json) also has a few issues:
> - write-json escapes forward slashes in strings for some reason ("/"
> become "\/")
> - read-json produces a structure similar to an association list but
> with '@' to indicate an object, making it not possible to use
> association list procedures directly.
>
> This is one step to move away from (guix build json), there will be
> other changes to remove the other uses of it.
Thanks for working on this! This is tedious but important work.
Cc’ing Jelle, who knows Node packaging well. Could you take a look,
Jelle?
One note:
> (define %node-build-system-modules
> ;; Build-side modules imported by default.
> `((guix build node-build-system)
> - (guix build json)
> + (json)
> + (json builder)
> + (json parser)
> + (json record)
> ,@%default-gnu-imported-modules))
This ends up being used like so:
(with-imported-modules %node-build-system-modules
#~(…))
The effect is to copy (json …) from the user’s load path into the build
environment. But this is not what we want, because one user might have
Guile-JSON 4.1 while another one has 4.7, and so they’d get different
derivations.
Instead, we should do:
(with-extensions (list guile-json)
(with-imported-modules %node-build-system-modules
#~(…)))
With extra care to resolve ‘guile-json’ lazily via ‘module-ref’.
Thanks,
Ludo’.
This bug report was last modified 95 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.