GNU bug report logs - #57560
[PATCH 0/4] Fix multiple hashcat issue.

Previous Next

Package: guix-patches;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Sat, 3 Sep 2022 12:05:01 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 57560 in the body.
You can then email your comments to 57560 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 ludo <at> gnu.org, guix-patches <at> gnu.org:
bug#57560; Package guix-patches. (Sat, 03 Sep 2022 12:05:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxime Devos <maximedevos <at> telenet.be>:
New bug report received and forwarded. Copy sent to ludo <at> gnu.org, guix-patches <at> gnu.org. (Sat, 03 Sep 2022 12:05:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: [PATCH 0/4] Fix multiple hashcat issue.
Date: Sat, 3 Sep 2022 14:04:42 +0200
[Message part 1 (text/plain, inline)]
X-Debbugs-CC: Hendursaga <hendursaga <at> aol.com>
X-Debbugs-CC: ( <paren <at> disroot.org>
X-Debbugs-CC: Tobias Geerinckx-Rice <me <at> tobias.gr>
X-Debbugs-CC: Ludovic Courtès <ludo <at> gnu.org>

(^ people involved in #57187)

This patch series:

 * Removed bundled libraries, except for LZMA-SDK for which I didn't
   find a corresponding Guix package
 * Makes hashcat cross-compilable, at least from an x86_64-linux-gnu to
   an aarch64-linux-gnu
 * Removes the embedded build time timestamp reported in
   <https://guix.gnu.org/57187>.

My current working tree is a bit dirty, so there will be a small rebase 
conflict because of the 6.2.4->6.2.5 and a few imports will need to be 
moved to the top of the file.

Greetings,
Maxime.

[Message part 2 (text/html, inline)]
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57560; Package guix-patches. (Sat, 03 Sep 2022 12:09:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57560 <at> debbugs.gnu.org
Cc: Maxime Devos <maximedevos <at> telenet.be>
Subject: [PATCH 4/4] gnu: hashcat: Fix cross-compilation.
Date: Sat,  3 Sep 2022 14:08:27 +0200
* gnu/packages/password-utils.scm
(hashcat)[native-inputs]: Move to ...
(hashcat)[inputs]: ... here.
(hashcat)[arguments]<#:make-flags>: Set AR and CC.
---
 gnu/packages/password-utils.scm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 172f633449..f92c47d539 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -1110,8 +1110,8 @@ (define-public pass-rotate
 your online accounts makes it necessary.")
     (license license:expat)))
 
-;; XXX: move this import upwards before merging this patch
-(use-modules (gnu packages digest))
+;; XXX: move these imports upwards before merging this patch
+(use-modules (gnu packages digest) (guix utils))
 (define-public hashcat
   (package
     (name "hashcat")
@@ -1130,13 +1130,13 @@ (define-public hashcat
         ;; TODO: Unbundle LZMA-SDK as well
         #~(for-each delete-file-recursively
                     '("deps/zlib" "deps/xxHash" "deps/OpenCL-Headers")))))
-    (native-inputs
-     (list opencl-headers))
-    (inputs (list minizip xxhash zlib))
+    (inputs (list minizip opencl-headers xxhash zlib))
     (build-system gnu-build-system)
     (arguments
      (list #:tests? #f ;no tests
-           #:make-flags #~(list (string-append "PREFIX="
+           #:make-flags #~(list (string-append "AR=" #$(ar-for-target))
+                                (string-append "CC=" #$(cc-for-target))
+                                (string-append "PREFIX="
                                                #$output)
                                 (string-append "USE_SYSTEM_ZLIB=1")
                                 (string-append "USE_SYSTEM_OPENCL=1")
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57560; Package guix-patches. (Sat, 03 Sep 2022 12:09:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57560 <at> debbugs.gnu.org
Cc: Maxime Devos <maximedevos <at> telenet.be>
Subject: [PATCH 3/4] hashcat: Rewrite with G-exps.
Date: Sat,  3 Sep 2022 14:08:26 +0200
This is required for cross-compilation, as %output does not exist when
cross-compiling.

* gnu/packages/password-utils.scm (hashcat)[arguments]: Rewrite with G-exps.
---
 gnu/packages/password-utils.scm | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index ec4aff048a..172f633449 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -1135,21 +1135,19 @@ (define-public hashcat
     (inputs (list minizip xxhash zlib))
     (build-system gnu-build-system)
     (arguments
-     '(#:tests? #f                      ;no tests
-       #:make-flags (list (string-append "PREFIX=" %output)
-                          ;; TODO: unbundle
-                          ;; (string-append "USE_SYSTEM_LZMA=1")
-                          (string-append "USE_SYSTEM_ZLIB=1")
-                          (string-append "USE_SYSTEM_OPENCL=1")
-                          (string-append "USE_SYSTEM_XXHASH=1"))
-       #:phases
-       (modify-phases %standard-phases
-         ;; Don't embed timestamps, for bit-for-bit reproducibility.
-         (add-after 'unpack 'fix-reproducibility
-           (lambda _
-             (substitute* "src/Makefile"
-               (("\\$\\(shell date \\+%s\\)") "0"))))
-         (delete 'configure))))
+     (list #:tests? #f ;no tests
+           #:make-flags #~(list (string-append "PREFIX="
+                                               #$output)
+                                (string-append "USE_SYSTEM_ZLIB=1")
+                                (string-append "USE_SYSTEM_OPENCL=1")
+                                (string-append "USE_SYSTEM_XXHASH=1"))
+           #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'fix-reproducibility
+                          (lambda _
+                            (substitute* "src/Makefile"
+                              (("\\$\\(shell date \\+%s\\)")
+                               "0"))))
+                        (delete 'configure))))
     (home-page "https://hashcat.net/hashcat/")
     (synopsis "Advanced password recovery utility")
     (description "Hashcat is an password recovery utility, supporting five
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57560; Package guix-patches. (Sat, 03 Sep 2022 12:09:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57560 <at> debbugs.gnu.org
Cc: Maxime Devos <maximedevos <at> telenet.be>
Subject: [PATCH 2/4] hashcat: Unbundle everything but LZMA-SDK.
Date: Sat,  3 Sep 2022 14:08:25 +0200
There does not appear to be a convenient Guix package for LZMA-SDK yet.
I currently have a bit of a dirty working tree (fiddling with imports), so the
use-modules is in the wrong place. Also, a small rebase conflict, the version
and source hash of hashcat has been updated.

* gnu/packages/password-utils.scm (hashcat)[source]{snippet}: Delete
everything from deps except for deps/LZMA-SDK.
(hashcat)[inputs]: Add minizip, xxhash and zlib.
(hashcat)[arguments]<#:make-flags>: Add USE_SYSTEM_ZLIB, USE_SYSTEM_OPENCL and
USE_SYSTEM_XXHASH.
---
 gnu/packages/password-utils.scm | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index f64a205610..ec4aff048a 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -1110,6 +1110,8 @@ (define-public pass-rotate
 your online accounts makes it necessary.")
     (license license:expat)))
 
+;; XXX: move this import upwards before merging this patch
+(use-modules (gnu packages digest))
 (define-public hashcat
   (package
     (name "hashcat")
@@ -1121,13 +1123,25 @@ (define-public hashcat
                            version ".tar.gz"))
        (sha256
         (base32
-         "104z63m7lqbb0sdrxhf9yi15l4a9zwf9m6zs9dbb3gf0nfxl1h9r"))))
+         "104z63m7lqbb0sdrxhf9yi15l4a9zwf9m6zs9dbb3gf0nfxl1h9r"))
+       (modules '((guix build utils)))
+       ;; Delete bundled libraries.
+       (snippet
+        ;; TODO: Unbundle LZMA-SDK as well
+        #~(for-each delete-file-recursively
+                    '("deps/zlib" "deps/xxHash" "deps/OpenCL-Headers")))))
     (native-inputs
      (list opencl-headers))
+    (inputs (list minizip xxhash zlib))
     (build-system gnu-build-system)
     (arguments
      '(#:tests? #f                      ;no tests
-       #:make-flags (list (string-append "PREFIX=" %output))
+       #:make-flags (list (string-append "PREFIX=" %output)
+                          ;; TODO: unbundle
+                          ;; (string-append "USE_SYSTEM_LZMA=1")
+                          (string-append "USE_SYSTEM_ZLIB=1")
+                          (string-append "USE_SYSTEM_OPENCL=1")
+                          (string-append "USE_SYSTEM_XXHASH=1"))
        #:phases
        (modify-phases %standard-phases
          ;; Don't embed timestamps, for bit-for-bit reproducibility.
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57560; Package guix-patches. (Sat, 03 Sep 2022 12:09:03 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57560 <at> debbugs.gnu.org
Cc: Maxime Devos <maximedevos <at> telenet.be>
Subject: [PATCH 1/4] hashcat: Don't embed timestamp, fixing reproducibility.
Date: Sat,  3 Sep 2022 14:08:24 +0200
* gnu/packages/password-utils.scm (hashcat)[arguments]{#:phases}:
Remove timestamp, fixing reproducibility.
---
 gnu/packages/password-utils.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 0069fdd74c..f64a205610 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -35,6 +35,7 @@
 ;;; Copyright © 2020 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;; Copyright © 2021 David Dashyan <mail <at> davie.li>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2022 Maxime Devos <maximedevos <at> telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1129,6 +1130,11 @@ (define-public hashcat
        #:make-flags (list (string-append "PREFIX=" %output))
        #:phases
        (modify-phases %standard-phases
+         ;; Don't embed timestamps, for bit-for-bit reproducibility.
+         (add-after 'unpack 'fix-reproducibility
+           (lambda _
+             (substitute* "src/Makefile"
+               (("\\$\\(shell date \\+%s\\)") "0"))))
          (delete 'configure))))
     (home-page "https://hashcat.net/hashcat/")
     (synopsis "Advanced password recovery utility")

base-commit: 57f8f69562e942557e3331bb81c7e4acd973d189
prerequisite-patch-id: 78c06b38a189109a5108a157d39ffe7eab8be109
prerequisite-patch-id: aaf0731113d36df901ed2186975e3bb872ec22c0
prerequisite-patch-id: 28e8223cfd59adf84007db9ceefd8a78c41fd10d
prerequisite-patch-id: fb73228d99c36f50e2959c2303c7c707460fd147
prerequisite-patch-id: 7626f1464f4926416fb13daf3d846176aa93f51b
prerequisite-patch-id: 445c6f624e99627959f2e54a6ee97337c44d9ea6
prerequisite-patch-id: 7a16c500faec9d58700a2b50b26bded079e9c3ac
prerequisite-patch-id: f7d406c61e069c04c3b7da453192f51c04763db1
prerequisite-patch-id: 4674bf40052d97215f837c9dfd4e7e1ae999492d
prerequisite-patch-id: 6259468375bfa157277521b17fdd97d6ab0748b7
prerequisite-patch-id: 9d14b38a33b68883c43d6b26dcdbdf7c28e417e7
prerequisite-patch-id: f0e3faffe768e9c660b0a9340042acfa0f790308
prerequisite-patch-id: 550485506255a67c0a1cb9ede7778d4d538b6e2a
prerequisite-patch-id: 9282e95ff076cc2c742be8d2fede83ac14006f6f
prerequisite-patch-id: 1503aa5c698f72ee47b7a987a95c0919efb203c4
prerequisite-patch-id: 24297940086a3780fd7e2e7fa345f262b12efb6f
prerequisite-patch-id: c5f647b5472465666328b123f0f314a6138d6293
prerequisite-patch-id: 56386c4df9130221cad664ec161d1ad9713f4dc3
prerequisite-patch-id: f09ccfb7e53bc7934326af603a197344f4ef53f3
prerequisite-patch-id: 0c18c83d1f2da4639b43861103a028706a147022
prerequisite-patch-id: 066bfca8bf0c3d3bc57a14b48aa1e241555c1e86
prerequisite-patch-id: 13d9ac7b0fadc92b9351409df26b41443497a964
prerequisite-patch-id: ad831a04543475288aba1c938078dcc5ad05870e
prerequisite-patch-id: ed9ec2d0bea23c2c2dbfa4c62290893f1a938f7f
prerequisite-patch-id: 335ce9dbbb2b36b960203a79fdc8f6033ebda2fb
prerequisite-patch-id: f2ca362056369913d0b8319187a8f46ea78b6dc7
prerequisite-patch-id: c02a17479ad4e01837fc307cf6defe0ae92e2435
prerequisite-patch-id: 3a794307f3bbd3641023d978f4b359eb2f5a46e4
prerequisite-patch-id: c545007535db365a29dc3a86e10866f5eef7b7d5
prerequisite-patch-id: 8b8fd18762282129e2d034f7cdceb368f53295d6
prerequisite-patch-id: d435d42bafa65f14049740a3d6cf1a163f855f97
prerequisite-patch-id: 27da1b857019b217b25b6795b84577fdc992a84c
prerequisite-patch-id: aef95e76144ae5e92a41f81b11e84ddc7ececd91
prerequisite-patch-id: 95aa6b45d93026e4375b53a471f0f96e2016914e
prerequisite-patch-id: 715d2bb93fe711e72388458846a0afde6babdc97
prerequisite-patch-id: 1851b8f26420465ac59f7447d9c8bd6698b77130
prerequisite-patch-id: 2bd6d4b30b6c71edef4bc6286a290f8eac5c18bd
-- 
2.37.2





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 04 Sep 2022 21:09:02 GMT) Full text and rfc822 format available.

Notification sent to Maxime Devos <maximedevos <at> telenet.be>:
bug acknowledged by developer. (Sun, 04 Sep 2022 21:09:03 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 57187-done <at> debbugs.gnu.org, 57560-done <at> debbugs.gnu.org,
 Hendursaga <hendursaga <at> aol.com>
Subject: Re: bug#57560: [PATCH 0/4] Fix multiple hashcat issue.
Date: Sun, 04 Sep 2022 23:08:12 +0200
Hi,

Maxime Devos <maximedevos <at> telenet.be> skribis:

> X-Debbugs-CC: Hendursaga <hendursaga <at> aol.com>
> X-Debbugs-CC: ( <paren <at> disroot.org>
> X-Debbugs-CC: Tobias Geerinckx-Rice <me <at> tobias.gr>
> X-Debbugs-CC: Ludovic Courtès <ludo <at> gnu.org>

That didn’t work.  :-)

> This patch series:
>
>  * Removed bundled libraries, except for LZMA-SDK for which I didn't
>    find a corresponding Guix package
>  * Makes hashcat cross-compilable, at least from an x86_64-linux-gnu to
>    an aarch64-linux-gnu
>  * Removes the embedded build time timestamp reported in
>    <https://guix.gnu.org/57187>.

Perfect!  I’ve applied it all.

> My current working tree is a bit dirty, so there will be a small
> rebase conflict because of the 6.2.4->6.2.5 and a few imports will
> need to be moved to the top of the file.

Right, I had to fiddle quite a bit with the patches to get them to
apply.

Thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 03 Oct 2022 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 203 days ago.

Previous Next


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