GNU bug report logs - #30007
[PATCH 0/2] gnu: borg: Unbundle libb2.

Previous Next

Package: guix-patches;

Reported by: Tobias Geerinckx-Rice <me <at> tobias.gr>

Date: Sat, 6 Jan 2018 15:49:02 UTC

Severity: normal

Tags: patch

Done: Tobias Geerinckx-Rice <me <at> tobias.gr>

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 30007 in the body.
You can then email your comments to 30007 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#30007; Package guix-patches. (Sat, 06 Jan 2018 15:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 06 Jan 2018 15:49:02 GMT) Full text and rfc822 format available.

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

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/2] gnu: borg: Unbundle libb2.
Date: Sat, 6 Jan 2018 16:51:01 +0100
Guix,

This adds a libb2 (BLAKE2) package and makes borg use that instead of
its bundled copy.

Not sure whether it belongs in crypto.scm or the new digest.scm wherein
I randomly plonked it. Not sure whether it matters.

Kind regards,

T G-R




Information forwarded to guix-patches <at> gnu.org:
bug#30007; Package guix-patches. (Sat, 06 Jan 2018 15:52:01 GMT) Full text and rfc822 format available.

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

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: 30007 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: Add libb2.
Date: Sat,  6 Jan 2018 16:54:17 +0100
* gnu/packages/digest.scm (libb2): New public variable.
---
 gnu/packages/digest.scm | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/digest.scm b/gnu/packages/digest.scm
index 5f14ab913..456980ea5 100644
--- a/gnu/packages/digest.scm
+++ b/gnu/packages/digest.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017 Tobias Geerinckx-Rice <me <at> tobias.gr>
+;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -17,9 +17,11 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages digest)
+  #:use-module (gnu packages autotools)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu))
 
 (define-public xxhash
@@ -53,3 +55,47 @@ The code is highly portable, and hashes of the same length are identical on all
 platforms (both big and little endian).")
     (license (list license:bsd-2        ; xxhash library (xxhash.[ch])
                    license:gpl2+))))    ; xxhsum.c
+
+(define-public libb2
+  (let ((revision "1")                  ; upstream doesn't ‘do’ releases
+        (commit "60ea749837362c226e8501718f505ab138e5c19d"))
+    (package
+      (name "libb2")
+      (version (string-append "0.0.0-" revision "." (string-take commit 7)))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/BLAKE2/libb2")
+                      (commit commit)))
+                (file-name (string-append name "-" version "-checkout"))
+                (sha256
+                 (base32
+                  "07a2m8basxrsj9dsp5lj24y8jraj85lfy56756a7za1nfkgy04z7"))))
+      (build-system gnu-build-system)
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,libtool)))
+      (arguments
+       `(#:configure-flags
+         (list "--enable-fat"           ; detect optimisations at run time...
+               "--disable-native")      ; ...not build time
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'bootstrap
+             (lambda _
+               (invoke "sh" "autogen.sh")
+               #t)))))
+      (home-page "https://blake2.net/")
+      (synopsis "Library implementing the BLAKE2 family of hash functions")
+      (description
+       "libb2 is a portable implementation of the BLAKE2 family of cryptographic
+hash functions.  It includes optimised implementations for IA-32 and AMD64
+processors, and an interface layer that automatically selects the best
+implementation for the processor it is run on.
+
+@dfn{BLAKE2} (RFC 7693) is a family of high-speed cryptographic hash functions
+that are faster than MD5, SHA-1, SHA-2, and SHA-3, yet are at least as secure
+as the latest standard, SHA-3.  It is an improved version of the SHA-3 finalist
+BLAKE.")
+      (license license:public-domain))))
-- 
2.15.0





Information forwarded to guix-patches <at> gnu.org:
bug#30007; Package guix-patches. (Sat, 06 Jan 2018 15:52:03 GMT) Full text and rfc822 format available.

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

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: 30007 <at> debbugs.gnu.org
Subject: [PATCH 2/2] gnu: borg: Unbundle libb2.
Date: Sat,  6 Jan 2018 16:54:18 +0100
* gnu/packages/backup.scm (borg)[source]: Remove bundled libb2 in snippet.
[inputs]: Add libb2.
[arguments]: Use it.
---
 gnu/packages/backup.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 2fba1a9e7..19a26dc9a 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2014, 2015 Eric Bavier <bavier <at> member.fsf.org>
 ;;; Copyright © 2014 Ian Denhardt <ian <at> zenhack.net>
 ;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo <at> famulari.name>
-;;; Copyright © 2017 Tobias Geerinckx-Rice <me <at> tobias.gr>
+;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2017 Thomas Danckaert <post <at> thomasdanckaert.be>
 ;;; Copyright © 2017 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;; Copyright © 2017 Kei Kebreau <kkebreau <at> posteo.net>
@@ -37,6 +37,7 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages digest)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages dejagnu)
   #:use-module (gnu packages ftp)
@@ -483,7 +484,7 @@ detection, and lossless compression.")
            ;; Remove bundled shared libraries.
            (with-directory-excursion "src/borg/algorithms"
              (for-each delete-file-recursively
-                       (list "lz4" "zstd")))))))
+                       (list "blake2" "lz4" "zstd")))))))
     (build-system python-build-system)
     (arguments
      `(#:modules ((srfi srfi-26) ; for cut
@@ -494,9 +495,11 @@ detection, and lossless compression.")
          (add-after 'unpack 'set-env
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((openssl (assoc-ref inputs "openssl"))
+                   (libb2 (assoc-ref inputs "libb2"))
                    (lz4 (assoc-ref inputs "lz4"))
                    (zstd (assoc-ref inputs "zstd")))
                (setenv "BORG_OPENSSL_PREFIX" openssl)
+               (setenv "BORG_LIBB2_PREFIX" libb2)
                (setenv "BORG_LIBLZ4_PREFIX" lz4)
                (setenv "BORG_LIBZSTD_PREFIX" zstd)
                (setenv "PYTHON_EGG_CACHE" "/tmp")
@@ -558,6 +561,7 @@ detection, and lossless compression.")
        ("python-guzzle-sphinx-theme" ,python-guzzle-sphinx-theme)))
     (inputs
      `(("acl" ,acl)
+       ("libb2" ,libb2)
        ("lz4" ,lz4)
        ("openssl" ,openssl)
        ("python-llfuse" ,python-llfuse)
-- 
2.15.0





Information forwarded to guix-patches <at> gnu.org:
bug#30007; Package guix-patches. (Sat, 06 Jan 2018 17:48:03 GMT) Full text and rfc822 format available.

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

From: Leo Famulari <leo <at> famulari.name>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 30007 <at> debbugs.gnu.org
Subject: Re: [bug#30007] [PATCH 0/2] gnu: borg: Unbundle libb2.
Date: Sat, 6 Jan 2018 12:47:16 -0500
[Message part 1 (text/plain, inline)]
On Sat, Jan 06, 2018 at 04:51:01PM +0100, Tobias Geerinckx-Rice wrote:
> Guix,
> 
> This adds a libb2 (BLAKE2) package and makes borg use that instead of
> its bundled copy.

Okay!

> Not sure whether it belongs in crypto.scm or the new digest.scm wherein
> I randomly plonked it. Not sure whether it matters.

I'd put it in crypto.scm since it is supposed to be cryptographically
secure.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#30007; Package guix-patches. (Sat, 06 Jan 2018 17:50:02 GMT) Full text and rfc822 format available.

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

From: Leo Famulari <leo <at> famulari.name>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 30007 <at> debbugs.gnu.org
Subject: Re: [bug#30007] [PATCH 1/2] gnu: Add libb2.
Date: Sat, 6 Jan 2018 12:49:10 -0500
[Message part 1 (text/plain, inline)]
On Sat, Jan 06, 2018 at 04:54:17PM +0100, Tobias Geerinckx-Rice wrote:
> * gnu/packages/digest.scm (libb2): New public variable.

> +      (name "libb2")
> +      (version (string-append "0.0.0-" revision "." (string-take commit 7)))

Use the (git-version) procedure here

> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference
> +                      (url "https://github.com/BLAKE2/libb2")
> +                      (commit commit)))
> +                (file-name (string-append name "-" version "-checkout"))

And (git-file-name)

> +           (add-after 'unpack 'bootstrap
> +             (lambda _
> +               (invoke "sh" "autogen.sh")
> +               #t)))))

(invoke) should raise an exception if something goes wrong;
otherwise it returns #t. Do we need that extra #t?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#30007; Package guix-patches. (Sat, 06 Jan 2018 17:50:02 GMT) Full text and rfc822 format available.

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

From: Leo Famulari <leo <at> famulari.name>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 30007 <at> debbugs.gnu.org
Subject: Re: [bug#30007] [PATCH 2/2] gnu: borg: Unbundle libb2.
Date: Sat, 6 Jan 2018 12:49:30 -0500
[Message part 1 (text/plain, inline)]
On Sat, Jan 06, 2018 at 04:54:18PM +0100, Tobias Geerinckx-Rice wrote:
> * gnu/packages/backup.scm (borg)[source]: Remove bundled libb2 in snippet.
> [inputs]: Add libb2.
> [arguments]: Use it.

LGTM, thanks!
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#30007; Package guix-patches. (Sat, 06 Jan 2018 18:10:02 GMT) Full text and rfc822 format available.

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

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: leo <at> famulari.name
Cc: 30007 <at> debbugs.gnu.org
Subject: Re: [bug#30007] [PATCH 1/2] gnu: Add libb2.
Date: Sat, 6 Jan 2018 19:12:01 +0100
[Message part 1 (text/plain, inline)]
Leo,

Leo Famulari wrote on 06/01/18 at 18:49:
> Use the (git-version) procedure here
> And (git-file-name)

Both new to me. Thanks!

>> +           (add-after 'unpack 'bootstrap
>> +             (lambda _
>> +               (invoke "sh" "autogen.sh")
>> +               #t)))))
> 
> (invoke) should raise an exception if something goes wrong;
> otherwise it returns #t. Do we need that extra #t?

Nope, the whole point of (invoke) was to replace my original use of
(system*), and the #t just got left in. Thanks for spotting!

Kind regards,

T G-R

[signature.asc (application/pgp-signature, attachment)]

Reply sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
You have taken responsibility. (Mon, 08 Jan 2018 14:12:01 GMT) Full text and rfc822 format available.

Notification sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
bug acknowledged by developer. (Mon, 08 Jan 2018 14:12:02 GMT) Full text and rfc822 format available.

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

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: 30007-done <at> debbugs.gnu.org
Subject: Re: [bug#30007] [PATCH 0/2] gnu: borg: Unbundle libb2.
Date: Mon, 8 Jan 2018 15:13:59 +0100
Tobias Geerinckx-Rice wrote on 06/01/18 at 16:51:
> This adds a libb2 (BLAKE2) package and makes borg use that instead of
> its bundled copy.

Pushed with suggested modifications as
c6220b13014f47a0aeb29975cdcf3c3b2b880b9d et al.

Thanks for the reviews,

T G-R




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

This bug report was last modified 7 years and 133 days ago.

Previous Next


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