GNU bug report logs - #49823
[PATCH] gnu: Add jsonnet.

Previous Next

Package: guix-patches;

Reported by: Vivien Kraus <vivien <at> planete-kraus.eu>

Date: Mon, 2 Aug 2021 15:02:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

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 49823 in the body.
You can then email your comments to 49823 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 guix-patches <at> gnu.org:
bug#49823; Package guix-patches. (Mon, 02 Aug 2021 15:02:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vivien Kraus <vivien <at> planete-kraus.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 02 Aug 2021 15:02:02 GMT) Full text and rfc822 format available.

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

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add jsonnet.
Date: Mon, 02 Aug 2021 17:01:07 +0200
[Message part 1 (text/plain, inline)]
Hello,

Here is jsonnet. I don’t fully understand what it does, but thanks to
leoprikler, I know it is a dependency to package GraalJS, an
interpreter for JavaScript on the Java Virtual Machine.

For the sake of having "no dependencies", it bundles a custom
implementation of MD5. According to a comment in the associated
license, it is taken from the implementation of bzflag, but it does not
seem to use the same as of today.

I decided to use nettle, and add a few lines of C++ to shape it into
the required interface.

Best regards,

Vivien
[0001-gnu-Add-jsonnet.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#49823; Package guix-patches. (Mon, 02 Aug 2021 16:16:01 GMT) Full text and rfc822 format available.

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

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: 49823 <at> debbugs.gnu.org
Subject: Using texinfo for the description
Date: Mon, 02 Aug 2021 18:15:17 +0200
[Message part 1 (text/plain, inline)]
maximed told me I could use texinfo in the description.

(I also removed a couple of lines in the C++ source because the
constant was not used.)

Also, I was advised to put the added source code in a local-file such
as what is done by gnuzilla, but I could not figure out how it was done
for gnuzilla (the package is quite large). If I go with a patch, there
are a lot of things that get deleted, so it makes a rather large patch.

What do you think?

Vivien
[0001-gnu-Add-jsonnet.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#49823; Package guix-patches. (Mon, 02 Aug 2021 16:36:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Vivien Kraus <vivien <at> planete-kraus.eu>, 49823 <at> debbugs.gnu.org
Subject: Re: [bug#49823] Using texinfo for the description
Date: Mon, 02 Aug 2021 18:35:18 +0200
[Message part 1 (text/plain, inline)]
Vivien Kraus via Guix-patches via schreef op ma 02-08-2021 om 18:15 [+0200]:
> maximed told me I could use texinfo in the description.
> 
> (I also removed a couple of lines in the C++ source because the
> constant was not used.)
> 
> Also, I was advised to put the added source code in a local-file such
> as what is done by gnuzilla, but I could not figure out how it was done
> for gnuzilla (the package is quite large).

Something like this should work (untested):

  (package
    (origin
      [...]
      (snippet
        #~(begin
            [...]
            (delete-file "third_party/md5/md5.cpp") ; maybe not necessary?
            (copy-file #+(search-auxiliary-file "jsonnet-md5.cpp")
                      "third_party/md5/md5.cpp")
            [...])))
    [...])

> If I go with a patch, there
> are a lot of things that get deleted, so it makes a rather large patch.

"git diff" has an option "--irreversible-deletes" and "--break-rewrites"
which should reduce the size of the patch, by not including the previous
version.

> What do you think?
> 
> Vivien
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#49823; Package guix-patches. (Mon, 02 Aug 2021 17:10:01 GMT) Full text and rfc822 format available.

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

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: Maxime Devos <maximedevos <at> telenet.be>, 49823 <at> debbugs.gnu.org
Subject: Re: [bug#49823] Using texinfo for the description
Date: Mon, 02 Aug 2021 19:09:10 +0200
[Message part 1 (text/plain, inline)]
Le lundi 02 août 2021 à 18:35 +0200, Maxime Devos a écrit :
> Something like this should work (untested):
> 
>   (package
>     (origin
>       [...]
>       (snippet
>         #~(begin

I didn’t know snippets could be Gexps. Thank you.
[0001-gnu-Add-jsonnet.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#49823; Package guix-patches. (Mon, 02 Aug 2021 17:53:02 GMT) Full text and rfc822 format available.

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

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: Vivien Kraus <vivien <at> planete-kraus.eu>, Maxime Devos
 <maximedevos <at> telenet.be>, 49823 <at> debbugs.gnu.org
Subject: Re: [bug#49823] Using texinfo for the description
Date: Mon, 02 Aug 2021 19:52:29 +0200
Hi Vivien,

sorry for coaxing you into packaging this thing, I merely noticed
graaljs using jsonnet and I'm pretty sure those paths will at some
point of the build need to get parsed.  ^^"

Am Montag, den 02.08.2021, 19:09 +0200 schrieb Vivien Kraus:
> +    (synopsis "The data templating language")
Should just be "Data templating language"
> +    (description "A data templating language for app and tool
> developers:
> +@itemize
> +@item Generate config data
> +@item Side-effect free
> +@item Organize, simplify, unify
> +@item Manage sprawling config
> +@end itemize
> +
> +A simple extension of JSON:
> +@itemize
> +@item Open source (Apache 2.0)
> +@item Familiar syntax
> +@item Reformatter, linter
> +@item Editor & IDE integrations
> +@item Formally specified
> +@end itemize
> +")
Sorry, but that's a little too much keyword soup.  Perhaps "Jsonnet is
a templating language extending JSON syntax with variables, conditions,
functions and more."
> +    (license license:asl2.0)))

> +     `(("json-modern-cxx" ,json-modern-cxx)
On a related note, we should imo rename this to nlohmann-json and patch
dependants accordingly.  What do others think?





Information forwarded to guix-patches <at> gnu.org:
bug#49823; Package guix-patches. (Mon, 02 Aug 2021 23:22:01 GMT) Full text and rfc822 format available.

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

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: Leo Prikler <leo.prikler <at> student.tugraz.at>, Maxime Devos
 <maximedevos <at> telenet.be>, 49823 <at> debbugs.gnu.org
Subject: Re: [bug#49823] Using texinfo for the description
Date: Tue, 03 Aug 2021 01:21:37 +0200
[Message part 1 (text/plain, inline)]
Here it is with the new wording.

Le lundi 02 août 2021 à 19:52 +0200, Leo Prikler a écrit :
> On a related note, we should imo rename this to nlohmann-json and
> patch
> dependants accordingly.  What do others think?
[0001-gnu-Add-jsonnet.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#49823; Package guix-patches. (Tue, 10 Aug 2021 12:59:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vivien Kraus <vivien <at> planete-kraus.eu>
Cc: 49823 <at> debbugs.gnu.org, Leo Prikler <leo.prikler <at> student.tugraz.at>,
 Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#49823: [PATCH] gnu: Add jsonnet.
Date: Tue, 10 Aug 2021 14:58:40 +0200
Hi Vivien,

Vivien Kraus <vivien <at> planete-kraus.eu> skribis:

> Here is jsonnet. I don’t fully understand what it does, but thanks to
> leoprikler, I know it is a dependency to package GraalJS, an
> interpreter for JavaScript on the Java Virtual Machine.
>
> For the sake of having "no dependencies", it bundles a custom
> implementation of MD5. According to a comment in the associated
> license, it is taken from the implementation of bzflag, but it does not
> seem to use the same as of today.
>
> I decided to use nettle, and add a few lines of C++ to shape it into
> the required interface.

I think using Nettle is a wise decision; however, it’s a decision for
upstream to make IMO.  I’m not comfortable with shipping custom
md5.{cpp,h} and CMakeLists.txt; to me, we’d be taking a bit too much of
upstream’s burden and delivering something that’s quite different.

Apart from that, the last patch you sent LGTM.

Thoughts?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#49823; Package guix-patches. (Tue, 10 Aug 2021 14:29:02 GMT) Full text and rfc822 format available.

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

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 49823 <at> debbugs.gnu.org, Leo
 Prikler <leo.prikler <at> student.tugraz.at>, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#49823: [PATCH] gnu: Add jsonnet.
Date: Tue, 10 Aug 2021 16:28:05 +0200
Hi!

Ludovic Courtès writes:
>> For the sake of having "no dependencies", it bundles a custom
>> implementation of MD5. According to a comment in the associated
>> license, it is taken from the implementation of bzflag, but it does not
>> seem to use the same as of today.
>>
>> I decided to use nettle, and add a few lines of C++ to shape it into
>> the required interface.
>
> I think using Nettle is a wise decision; however, it’s a decision for
> upstream to make IMO.  I’m not comfortable with shipping custom
> md5.{cpp,h} and CMakeLists.txt; to me, we’d be taking a bit too much of
> upstream’s burden and delivering something that’s quite different.

OK. Should I keep the bundled MD5 implementation then?

Vivien




Information forwarded to guix-patches <at> gnu.org:
bug#49823; Package guix-patches. (Wed, 11 Aug 2021 09:57:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vivien Kraus <vivien <at> planete-kraus.eu>
Cc: 49823 <at> debbugs.gnu.org, Leo
 Prikler <leo.prikler <at> student.tugraz.at>, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#49823: [PATCH] gnu: Add jsonnet.
Date: Wed, 11 Aug 2021 11:56:46 +0200
Hi,

Vivien Kraus <vivien <at> planete-kraus.eu> skribis:

> Ludovic Courtès writes:
>>> For the sake of having "no dependencies", it bundles a custom
>>> implementation of MD5. According to a comment in the associated
>>> license, it is taken from the implementation of bzflag, but it does not
>>> seem to use the same as of today.
>>>
>>> I decided to use nettle, and add a few lines of C++ to shape it into
>>> the required interface.
>>
>> I think using Nettle is a wise decision; however, it’s a decision for
>> upstream to make IMO.  I’m not comfortable with shipping custom
>> md5.{cpp,h} and CMakeLists.txt; to me, we’d be taking a bit too much of
>> upstream’s burden and delivering something that’s quite different.
>
> OK. Should I keep the bundled MD5 implementation then?

Yeah, I think so.  Clearly it’s a gray area, there are pros and cons,
but I’d lean towards minimal changes to upstream source.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#49823; Package guix-patches. (Wed, 11 Aug 2021 10:14:02 GMT) Full text and rfc822 format available.

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

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 49823 <at> debbugs.gnu.org, Leo
 Prikler <leo.prikler <at> student.tugraz.at>, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#49823: [PATCH] gnu: Add jsonnet.
Date: Wed, 11 Aug 2021 12:12:46 +0200
[Message part 1 (text/plain, inline)]
Ludovic Courtès writes:
>> OK. Should I keep the bundled MD5 implementation then?
>
> Yeah, I think so.  Clearly it’s a gray area, there are pros and cons,
> but I’d lean towards minimal changes to upstream source.

Here you go :)

[0001-gnu-Add-jsonnet.patch (text/x-patch, attachment)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Thu, 12 Aug 2021 07:55:02 GMT) Full text and rfc822 format available.

Notification sent to Vivien Kraus <vivien <at> planete-kraus.eu>:
bug acknowledged by developer. (Thu, 12 Aug 2021 07:55:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vivien Kraus <vivien <at> planete-kraus.eu>
Cc: 49823-done <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>,
 Leo Prikler <leo.prikler <at> student.tugraz.at>
Subject: Re: bug#49823: [PATCH] gnu: Add jsonnet.
Date: Thu, 12 Aug 2021 09:53:53 +0200
[Message part 1 (text/plain, inline)]
Hi Vivien,

Vivien Kraus <vivien <at> planete-kraus.eu> skribis:

> From 8ce461001ed14c3267d839334e4853feaed69b50 Mon Sep 17 00:00:00 2001
> From: Vivien Kraus <vivien <at> planete-kraus.eu>
> Date: Mon, 2 Aug 2021 16:07:08 +0200
> Subject: [PATCH] gnu: Add jsonnet.
>
> * gnu/packages/cpp.scm (jsonnet): New variable.

Applied with the tweak below.

Thank you, and thanks for taking the time for the extra work!

Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 870c02dac3..8c8109fb83 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -1232,16 +1232,13 @@ of reading and writing XML.")
             (rename-file "third_party/md5" ".md5")
             (delete-file-recursively "third_party")
             (delete-file-recursively "doc/third_party")
-            (substitute*
-                '("core/vm.cpp")
+            (substitute* '("core/vm.cpp")
               (("#include \"json.hpp\"") "#include <nlohmann/json.hpp>"))
             (mkdir "third_party")
             (rename-file ".md5" "third_party/md5")))))
     (build-system cmake-build-system)
     (arguments
      `(#:configure-flags '("-DUSE_SYSTEM_GTEST=ON" "-DUSE_SYSTEM_JSON=ON")))
-    (propagated-inputs
-     '())
     (native-inputs
      `(("googletest" ,googletest)
        ("pkg-config" ,pkg-config)))

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 09 Sep 2021 11:24:04 GMT) Full text and rfc822 format available.

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

Previous Next


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