Message ID | 20160710215438.15418.98984@what |
---|---|
State | New |
Headers |
Received: (qmail 59312 invoked by uid 89); 10 Jul 2016 21:54:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:742 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: lists.gnu.org Received: from lists.gnu.org (HELO lists.gnu.org) (208.118.235.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 10 Jul 2016 21:54:54 +0000 Received: from localhost ([::1]:56977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <guix-devel-bounces+patchwork=sourceware.org@gnu.org>) id 1bMMge-0001Zm-5D for patchwork@sourceware.org; Sun, 10 Jul 2016 17:54:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <sankeytms@gmail.com>) id 1bMMgY-0001ZU-Pa for guix-devel@gnu.org; Sun, 10 Jul 2016 17:54:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <sankeytms@gmail.com>) id 1bMMgV-0005q3-Mb for guix-devel@gnu.org; Sun, 10 Jul 2016 17:54:46 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:33278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <sankeytms@gmail.com>) id 1bMMgV-0005pt-IB for guix-devel@gnu.org; Sun, 10 Jul 2016 17:54:43 -0400 Received: by mail-qt0-x244.google.com with SMTP id j37so796250qta.0 for <guix-devel@gnu.org>; Sun, 10 Jul 2016 14:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:content-transfer-encoding:to:message-id:from :user-agent:subject:date; bh=9ot/uuxFkoPN5+tY4B85N1f32Dsj8g1TJVW4OS0SoJ8=; b=FJnAteYwmhKMQ28fbk4AUeSjuRR8udpk7kSX1MVQmfzsoWx1lSkAuRYf0ZELz1Os/G cGU1NMz+vDpQN5mKrGg6XGWWStH8u4DR3UbclyDPzQCbm17jFDr3joE9xJPQBqiJo8tF ziDjGfBdCGJg05DhkM5iGtcOa1lgAeZuJ4dQAeZ2ezEtWI+ah5gEvjmweNNQOSJghZ3u 0q9QhmK9JEDCeb3Q88vX/i4Hem+5W3qw5h06hi0Rc+ggik7/bmfcxfROZI9yrg9dc93k 0EzcJRROOKRGBdukX7mjjEFGLUubpUVr1ztlgGkNbpAnC1NBaHa7SadZLcrtttvMc8TK JqLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:content-transfer-encoding:to :message-id:from:user-agent:subject:date; bh=9ot/uuxFkoPN5+tY4B85N1f32Dsj8g1TJVW4OS0SoJ8=; b=KhMf+B+FN85O4dfm1q7S0xLcnT0Zw1GbGlEsDZyvH37C+YVKtCrq2jWYcBMdGSpE9J 1UQXvGYoxw+GRszQXf/dAKJZQCMnljFBHOcHlgVzyxKCtLkXy0cfrklgDTp94PG0gjjq i1MOzuCjD6KsbfdKuuhBkE/+OWIT38v6c/OUz6gzM4nBzAPGJRhGYU5yGd+li7MEHBZq u5iJudsI8e8oVJEV/Pp5k2FtZqGgSmfEWS9IxWOtzIWwe5luDvoyS94BuN7szeI5qFsU P2KuCKT6SscC17ip7qrFpD6NJy4EnTyYZd1KDvTegw8OrWedo1KcspQXWhdA3jCF9vMm 9Jug== X-Gm-Message-State: ALyK8tI1c5/jyEgmh3x4Npe1ju0tijE/noOF/FGJPNLvcCknl1WNNiehhSS4ENfxnRZ9/g== X-Received: by 10.200.36.13 with SMTP id c13mr25361493qtc.88.1468187682616; Sun, 10 Jul 2016 14:54:42 -0700 (PDT) Received: from localhost (c-73-167-118-183.hsd1.ma.comcast.net. [73.167.118.183]) by smtp.gmail.com with ESMTPSA id l129sm1258058qke.27.2016.07.10.14.54.41 for <guix-devel@gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jul 2016 14:54:42 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: guix-devel <guix-devel@gnu.org> Message-ID: <20160710215438.15418.98984@what> From: Troy Sankey <sankeytms@gmail.com> User-Agent: alot/0.3.6 Subject: [PATCH] doc: clarification for hashing git checkouts Date: Sun, 10 Jul 2016 17:54:38 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c0d::244 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." <guix-devel.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-devel>, <mailto:guix-devel-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/archive/html/guix-devel/> List-Post: <mailto:guix-devel@gnu.org> List-Help: <mailto:guix-devel-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-devel>, <mailto:guix-devel-request@gnu.org?subject=subscribe> Errors-To: guix-devel-bounces+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" <guix-devel-bounces+patchwork=sourceware.org@gnu.org> |
Commit Message
Troy Sankey
July 10, 2016, 9:54 p.m. UTC
When hashing git checkouts of packages, packagers must first remove the .git directory. This commit adds this clarification to the "Invoking guix hash" page in the documentation. --- doc/guix.texi | 3 +++ 1 file changed, 3 insertions(+)
Comments
On Sun, Jul 10, 2016 at 05:54:38PM -0400, Troy Sankey wrote: > When hashing git checkouts of packages, packagers must first remove the .git > directory. This commit adds this clarification to the "Invoking guix hash" > page in the documentation. Yes! This is one that *everybody* has to ask. I think it would be better in section '5.1.2 origin reference', because that is where the origin methods (url-fetch, git-fetch, etc) and the sha256 field are documented. In that case, it could go along with explanations of how to calculate the hash for cvs-download, hg-download, and svn-download. What do others think?
On Sun, Jul 10, 2016 at 07:16:30PM -0400, Leo Famulari wrote: > On Sun, Jul 10, 2016 at 05:54:38PM -0400, Troy Sankey wrote: > > When hashing git checkouts of packages, packagers must first remove the .git > > directory. This commit adds this clarification to the "Invoking guix hash" > > page in the documentation. > > Yes! This is one that *everybody* has to ask. And only now I am understanding a problem ages ago. Would this also be the reason for git sub-modules not to work? We don't use them, but sometimes it would be a nice intermediate stage for writing a package definition. Pj.
Quoting Pjotr Prins (2016-07-10 20:13:26) > And only now I am understanding a problem ages ago. Would this also be > the reason for git sub-modules not to work? Pjotr, If I'm understanding correctly, you failed to generate the hash of a git repository containing submodules? In that case, you may need to delete the .git file under each submodule directory in addition to the top level .git directory. Hashing sources is becoming quite compilated! I can't wait until 'guix download' supports git, then this could be automated. Troy
Yes, that is how I understand it previously did not work for me. Thanks :) On Mon, Jul 11, 2016 at 01:33:40AM -0400, Troy Sankey wrote: > Quoting Pjotr Prins (2016-07-10 20:13:26) > > And only now I am understanding a problem ages ago. Would this also be > > the reason for git sub-modules not to work? > > Pjotr, > > If I'm understanding correctly, you failed to generate the hash of a git > repository containing submodules? In that case, you may need to delete the > .git file under each submodule directory in addition to the top level .git > directory. > > Hashing sources is becoming quite compilated! I can't wait until 'guix > download' supports git, then this could be automated. > > Troy > --
On Mon, Jul 11, 2016 at 01:33:40AM -0400, Troy Sankey wrote: > Hashing sources is becoming quite compilated! I can't wait until 'guix > download' supports git, then this could be automated. In that case, `guix download` would need to take a Git hash as an argument. In general, I think it's a good idea to avoid `guix download` when writing packages, unless you make sure to double-check that the package's origin field works as expected. I've submitted packages with a bad URL that was masked because the tarball was already in my store from `guix download`. So, now I always download my sources "by hand" and calculate the hash from the result of that.
diff --git a/doc/guix.texi b/doc/guix.texi index c9d9bd8..f9fe85a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4533,6 +4533,9 @@ hash (@pxref{Invoking guix archive}). @c FIXME: Replace xref above with xref to an ``Archive'' section when @c it exists. +When hashing a git checkout, be sure to remove the git configuration +directory (@code{rm -r .git}) as it will erroneously impact the hash. + @end table @node Invoking guix import