GNU bug report logs - #36752
[PATCH 0/2] git-annex: Don't patch hook shebangs and update version

Previous Next

Package: guix-patches;

Reported by: Kyle Meyer <kyle <at> kyleam.com>

Date: Sun, 21 Jul 2019 19:47:02 UTC

Severity: normal

Tags: patch

Done: Marius Bakke <mbakke <at> fastmail.com>

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 36752 in the body.
You can then email your comments to 36752 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#36752; Package guix-patches. (Sun, 21 Jul 2019 19:47:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kyle Meyer <kyle <at> kyleam.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 21 Jul 2019 19:47:04 GMT) Full text and rfc822 format available.

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

From: Kyle Meyer <kyle <at> kyleam.com>
To: guix-patches <at> gnu.org
Cc: Timothy Sample <samplet <at> ngyro.com>, Kyle Meyer <kyle <at> kyleam.com>
Subject: [PATCH 0/2] git-annex: Don't patch hook shebangs and update version
Date: Sun, 21 Jul 2019 15:46:26 -0400
The git-annex definition patches the snippet that git-annex uses as the
shebang when creating its Git hooks.  As discussed previously [1], this is
problematic because the hooks refer to a bash that may later be garbage
collected.

However, a large number of the tests fail if we simply don't patch the shebang
because the hooks of course can't find the unpatched "/bin/sh" in the build
environment [2].  The first patch updates the definition to use a "patch,
build, test, revert patch, re-build" sequence.  It's not pretty, but it
certainly seems better than disabling the tests.  Please let me know if you
have suggestions for a cleaner approach.

The second patch updates git-annex to its latest version.

[1] https://lists.gnu.org/archive/html/guix-devel/2018-08/msg00142.html
[2] https://lists.gnu.org/archive/html/guix-devel/2019-02/msg00012.html

Kyle Meyer (2):
  gnu: git-annex: Don't patch shebang used in hooks.
  gnu: git-annex: Update to 7.20190708.

 gnu/packages/haskell-apps.scm | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

-- 
2.22.0





Information forwarded to guix-patches <at> gnu.org:
bug#36752; Package guix-patches. (Sun, 21 Jul 2019 19:52:02 GMT) Full text and rfc822 format available.

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

From: Kyle Meyer <kyle <at> kyleam.com>
To: 36752 <at> debbugs.gnu.org
Cc: Timothy Sample <samplet <at> ngyro.com>, Kyle Meyer <kyle <at> kyleam.com>
Subject: [PATCH 1/2] gnu: git-annex: Don't patch shebang used in hooks.
Date: Sun, 21 Jul 2019 15:50:57 -0400
git-annex relies on configuring Git's pre-commit and post-receive hooks.
Avoid patching the shebang that git-annex embeds when generating these hooks
so that the hooks don't fail if garbage collection claims the bash that was
current when the annex repository was initialized.

* gnu/packages/haskell-apps.scm (git-annex):[arguments]: Patch hook shebangs
only temporarily for tests.
---
 gnu/packages/haskell-apps.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm
index d675863090..15a6686ed6 100644
--- a/gnu/packages/haskell-apps.scm
+++ b/gnu/packages/haskell-apps.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2018 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;; Copyright © 2016, 2017 Leo Famulari <leo <at> famulari.name>
 ;;; Copyright © 2015 Paul van der Walt <paul <at> denknerd.org>
+;;; Copyright © 2019 Kyle Meyer <kyle <at> kyleam.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -158,8 +159,13 @@ (define-public git-annex
        '("--flags=-Android -Assistant -Pairing -S3 -Webapp -WebDAV")
        #:phases
        (modify-phases %standard-phases
-         (add-before 'configure 'patch-shell
+         (add-before 'configure 'patch-shell-for-tests
            (lambda _
+             ;; Shell.hs defines "/bin/sh" that is used in Git hooks.  We
+             ;; shouldn't patch hooks with Guix's current bash because the
+             ;; hooks can exist after that bash is garbage collected, but
+             ;; let's temporarily patch it so that we can run the tests.
+             (copy-file "Utility/Shell.hs" "/tmp/Shell.hs")
              (substitute* "Utility/Shell.hs"
                (("/bin/sh") (which "sh")))
              #t))
@@ -193,6 +199,11 @@ (define-public git-annex
                (symlink "git-annex" "git-annex-shell"))
              (invoke "git-annex" "test")
              #t))
+         (add-after 'check 'unpatch-shell-and-rebuild
+           (lambda args
+             ;; Undo `patch-shell-for-tests'.
+             (copy-file "/tmp/Shell.hs" "Utility/Shell.hs")
+             (apply (assoc-ref %standard-phases 'build) args)))
          (add-after 'install 'install-symlinks
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-- 
2.22.0





Information forwarded to guix-patches <at> gnu.org:
bug#36752; Package guix-patches. (Sun, 21 Jul 2019 19:52:03 GMT) Full text and rfc822 format available.

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

From: Kyle Meyer <kyle <at> kyleam.com>
To: 36752 <at> debbugs.gnu.org
Cc: Timothy Sample <samplet <at> ngyro.com>, Kyle Meyer <kyle <at> kyleam.com>
Subject: [PATCH 2/2] gnu: git-annex: Update to 7.20190708.
Date: Sun, 21 Jul 2019 15:50:58 -0400
* gnu/packages/haskell-apps.scm (git-annex): Update to 7.20190708.
[inputs]: Add new dependency, ghc-concurrent-output.
---
 gnu/packages/haskell-apps.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm
index 15a6686ed6..fa0111796d 100644
--- a/gnu/packages/haskell-apps.scm
+++ b/gnu/packages/haskell-apps.scm
@@ -144,7 +144,7 @@ (define-public darcs
 (define-public git-annex
   (package
     (name "git-annex")
-    (version "6.20180926")
+    (version "7.20190708")
     (source
      (origin
        (method url-fetch)
@@ -152,7 +152,7 @@ (define-public git-annex
                            "git-annex/git-annex-" version ".tar.gz"))
        (sha256
         (base32
-         "1251rj8h63y30sfqk0zh670yhz14p256y59n3590pg015pf3575d"))))
+         "18s563swrp8mx479995pdhhmn40y3xwlbm1z3w63qsnjqmj7zlij"))))
     (build-system haskell-build-system)
     (arguments
      `(#:configure-flags
@@ -220,6 +220,7 @@ (define-public git-annex
        ("ghc-bloomfilter" ,ghc-bloomfilter)
        ("ghc-byteable" ,ghc-byteable)
        ("ghc-case-insensitive" ,ghc-case-insensitive)
+       ("ghc-concurrent-output" ,ghc-concurrent-output)
        ("ghc-crypto-api" ,ghc-crypto-api)
        ("ghc-cryptonite" ,ghc-cryptonite)
        ("ghc-data-default" ,ghc-data-default)
-- 
2.22.0





Information forwarded to guix-patches <at> gnu.org:
bug#36752; Package guix-patches. (Tue, 23 Jul 2019 02:48:01 GMT) Full text and rfc822 format available.

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

From: Kyle Meyer <kyle <at> kyleam.com>
To: 36752 <at> debbugs.gnu.org
Cc: Timothy Sample <samplet <at> ngyro.com>
Subject: Re: [PATCH 1/2] gnu: git-annex: Don't patch shebang used in hooks.
Date: Mon, 22 Jul 2019 22:47:18 -0400
Kyle Meyer <kyle <at> kyleam.com> writes:

> * gnu/packages/haskell-apps.scm (git-annex):[arguments]: Patch hook shebangs
> only temporarily for tests.

Oops, a stray ":" slipped in there.  If a reroll doesn't end up being
needed for other reasons, I'd appreciate if that could be touched up
when applying.




Reply sent to Marius Bakke <mbakke <at> fastmail.com>:
You have taken responsibility. (Thu, 08 Aug 2019 18:23:01 GMT) Full text and rfc822 format available.

Notification sent to Kyle Meyer <kyle <at> kyleam.com>:
bug acknowledged by developer. (Thu, 08 Aug 2019 18:23:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Kyle Meyer <kyle <at> kyleam.com>, 36752-done <at> debbugs.gnu.org
Subject: Re: [bug#36752] [PATCH 0/2] git-annex: Don't patch hook shebangs and
 update version
Date: Thu, 08 Aug 2019 20:22:04 +0200
[Message part 1 (text/plain, inline)]
Kyle Meyer <kyle <at> kyleam.com> writes:

> The git-annex definition patches the snippet that git-annex uses as the
> shebang when creating its Git hooks.  As discussed previously [1], this is
> problematic because the hooks refer to a bash that may later be garbage
> collected.
>
> However, a large number of the tests fail if we simply don't patch the shebang
> because the hooks of course can't find the unpatched "/bin/sh" in the build
> environment [2].  The first patch updates the definition to use a "patch,
> build, test, revert patch, re-build" sequence.  It's not pretty, but it
> certainly seems better than disabling the tests.  Please let me know if you
> have suggestions for a cleaner approach.
>
> The second patch updates git-annex to its latest version.
>
> [1] https://lists.gnu.org/archive/html/guix-devel/2018-08/msg00142.html
> [2] https://lists.gnu.org/archive/html/guix-devel/2019-02/msg00012.html
>
> Kyle Meyer (2):
>   gnu: git-annex: Don't patch shebang used in hooks.
>   gnu: git-annex: Update to 7.20190708.

Thank you for fixing the shebang bug, and for updating the package.

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

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

This bug report was last modified 4 years and 231 days ago.

Previous Next


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