From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timothy Sample Subject: Re: git-annex: problematic shebangs in .git/hooks/pre-commit? Date: Sun, 03 Feb 2019 14:47:39 -0500 Message-ID: <87r2cohcx0.fsf@ngyro.com> References: <876001xe9c.fsf@kyleam.com> <87wosh2ftj.fsf@ngyro.com> <8736v5xbcq.fsf@kyleam.com> <87o9ds3kyy.fsf@ngyro.com> <87y373m4y7.fsf@kyleam.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:45272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqNk5-0004Ws-WF for guix-devel@gnu.org; Sun, 03 Feb 2019 14:47:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqNk4-0008GY-UH for guix-devel@gnu.org; Sun, 03 Feb 2019 14:47:49 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:40725) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gqNk4-0008CX-LD for guix-devel@gnu.org; Sun, 03 Feb 2019 14:47:48 -0500 In-Reply-To: <87y373m4y7.fsf@kyleam.com> (Kyle Meyer's message of "Tue, 29 Jan 2019 18:14:56 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Kyle Meyer Cc: guix-devel Hi Kyle, Kyle Meyer writes: > Timothy Sample writes: > >> Kyle Meyer 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. Thanks for giving this a try! > Any suggestions on how to deal with this? I am travelling at the moment, so I can=E2=80=99t dig into it properly. I crossed my fingers and tried symlinking /bin/sh to bash, but did not have permission to make the /bin directory. (I guessed the build user would be able to do this from within the build environment, but apparently not.) It would be ideal to set up the build environment like this, but I=E2=80=99m not sure how. > --- > diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-cont= rol.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=3D-Android -Assistant -Pairing -S3 -Webapp -WebDAV") > #:phases > (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 -- Tim