[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: git-annex: problematic shebangs in .git/hooks/pre-commit?

From: Kyle Meyer
Subject: Re: git-annex: problematic shebangs in .git/hooks/pre-commit?
Date: Tue, 29 Jan 2019 18:14:56 -0500

Timothy Sample <address@hidden> writes:

> Kyle Meyer <address@hidden> writes:


>> Perhaps I'm just missing something, but to spell out my concern a
>> little
>> more: I have /gnu/store/A/git-annex and /gnu/store/X/bash-minimal.  I
>> set up a repo with 'git annex init', and
>> /gnu/store/X/bash-minimal/bin/sh is used in the shebang.
>> Some time later I am using /gnu/store/B/git-annex, which references
>> /gnu/store/Y/bash-minimal.  That repo's hook still uses the
>> X/bash-minimal/bin/sh.  But if /gnu/store/X/bash-minimal is no longer
>> referenced by any package, it could be garbage collected, leading to
>> the
>> hook failing.
> Ah yes!  That could be a problem indeed.  Good catch.  Following the
> example of autoconf, it seems it should just be left alone.

Revisiting this, I tried to simply remove the patch-shell phase (diff
below).  That worked as intended when I tested manually, but it caused
many test failures with messages like

    fatal: cannot run .git/hooks/pre-commit: No such file or directory

Although the error message isn't too clear, this happens because
/bin/sh, now used in the hook shebangs, isn't available to the tests
executed in the build environment.

Any suggestions on how to deal with this?

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index dc2abb0c71..56fe6f5e7a 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -2236,11 +2236,6 @@ (define-public git-annex
        '("--flags=-Android -Assistant -Pairing -S3 -Webapp -WebDAV")
        (modify-phases %standard-phases
-         (add-before 'configure 'patch-shell
-           (lambda _
-             (substitute* "Utility/Shell.hs"
-               (("/bin/sh") (which "sh")))
-             #t))
          (add-before 'configure 'factor-setup
            (lambda _
              ;; Factor out necessary build logic from the provided

reply via email to

[Prev in Thread] Current Thread [Next in Thread]