From patchwork Mon Jul 11 05:18:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Sankey X-Patchwork-Id: 13729 Received: (qmail 109180 invoked by uid 89); 11 Jul 2016 05:18:57 -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=integrity, mandatory 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; Mon, 11 Jul 2016 05:18:55 +0000 Received: from localhost ([::1]:57920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMTcL-00048k-D6 for patchwork@sourceware.org; Mon, 11 Jul 2016 01:18:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMTcB-00048R-Jy for guix-devel@gnu.org; Mon, 11 Jul 2016 01:18:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMTc1-00063F-3M for guix-devel@gnu.org; Mon, 11 Jul 2016 01:18:38 -0400 Received: from mail-qt0-x236.google.com ([2607:f8b0:400d:c0d::236]:34576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMTc0-000638-Su for guix-devel@gnu.org; Mon, 11 Jul 2016 01:18:33 -0400 Received: by mail-qt0-x236.google.com with SMTP id u25so23801647qtb.1 for ; Sun, 10 Jul 2016 22:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:to:from:in-reply-to:cc:references:message-id :user-agent:subject:date; bh=9543QBXO171fO4wIEU1lVH4NmBVHTYoxdtMGCaG2TQ8=; b=qLcVPL+GbHTcomTXP2K7Xz0PiKi231kXHfm3AOhXQ5n8ySJ6Cp80DrKw0dFbSH6Oob Pk8ATQLICzhkmRLNVdmvzrXZB+jLic+HYAoRMAHkZwxB1u/tvQqhMGrESfqxSg/yI0r3 1GDZ6KyZjEwNfa7xvYYYdwbgkCdNfvFWP6oQMvmhp3Tpqx2a5r5LlFtWVyMQ044JALqB dWGQWSXCNBGZ10HgaEnrsbp3yBsLeFkEQ1WKQfBgphYiKhamWjflLIsLBb7oq/haHQXh jhrTA34BovrubAHGThKQ9T2aIO1/4RXtN5JJ3QHRWh0LBnpx9OvqZq4I0372CUpt3Yza /jDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:to:from:in-reply-to:cc:references :message-id:user-agent:subject:date; bh=9543QBXO171fO4wIEU1lVH4NmBVHTYoxdtMGCaG2TQ8=; b=fH67pyNba+ounKQHrpHSG19WqFhP/i7HcMiiu3PG+3ZBt+rg2VWa0IAZmAsltDD7Ip d/QixwiRagV2qMEQrLrdSbHUw+d5TcSc+jmfo0VoInCkG2JKgUAaXKsRTRwaZJbz2TBL J/TtmfVgLGsQEWFEJZipRrsbD4+2gds6Z4n8vOP+yxnMBcNBW8fhjDesqcDQ2JiXC3V8 RIXmfLLmI7dXXFc7sVHoUlskxPZ4of2vQ8beGhuztUIUHBAHgiR+eQRk/lt97GK7wcG9 tcNDVGeYmKI57tqCotrRidS0fILPGX6KVA+++2sXTnZXOGE1577xfiLAAaMh0zlZ4Gas HT+Q== X-Gm-Message-State: ALyK8tLfThgtdjlBIyK4m3211SGaXGNoKJ8XtCJrrC2lNistvunW+SEI+X6/EPLrLJjAzQ== X-Received: by 10.200.47.253 with SMTP id m58mr18957902qta.60.1468214312554; Sun, 10 Jul 2016 22:18:32 -0700 (PDT) Received: from localhost (c-98-217-8-51.hsd1.ma.comcast.net. [98.217.8.51]) by smtp.gmail.com with ESMTPSA id z94sm1271677qtc.49.2016.07.10.22.18.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jul 2016 22:18:31 -0700 (PDT) MIME-Version: 1.0 To: Leo Famulari , From: Troy Sankey In-Reply-To: <20160710231630.GA10509@jasmine> References: <20160710215438.15418.98984@what> <20160710231630.GA10509@jasmine> Message-ID: <20160711051831.15418.45217@what> User-Agent: alot/0.3.6 Subject: Re: [PATCH] doc: clarification for hashing git checkouts Date: Mon, 11 Jul 2016 01:18:31 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c0d::236 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel Errors-To: guix-devel-bounces+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" Quoting Leo Famulari (2016-07-10 19:16:30) > 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've asked it, and I've since seen two more ask on IRC :) > 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? I think what is really missing is a reference to 'Invoking guix hash' from '5.1.2 origin reference'. My new patch includes that reference, along with your other suggested explainations about other VCS. I think it is important that we direct people to the right tools for the job---beginning packagers should not yet be concerned about the specifics of using 'guix hash' before they learn the name of the tool. Troy From 42b26d3601a6318bcefa4dfe4018daddc521e27a Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Sun, 10 Jul 2016 17:45:55 -0400 Subject: [PATCH] doc: clarification for hashing git checkouts When hashing git checkouts of packages, packagers must first remove the .git directory. This commit adds this clarification to the "Invoking guix hash" section in the documentation, and makes a few more related changes throughout the rest of the document. --- doc/guix.texi | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index c9d9bd8..26284ac 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2425,7 +2425,7 @@ The @code{sha256} field specifies the expected SHA256 hash of the file being downloaded. It is mandatory, and allows Guix to check the integrity of the file. The @code{(base32 @dots{})} form introduces the base32 representation of the hash. You can obtain this information with -@code{guix download} (@pxref{Invoking guix download}) and @code{guix +@code{guix download} (@pxref{Invoking guix download}) or @code{guix hash} (@pxref{Invoking guix hash}). @cindex patches @@ -2684,7 +2684,9 @@ specified in the @code{uri} field as a @code{git-reference} object; a @item @code{sha256} A bytevector containing the SHA-256 hash of the source. Typically the @code{base32} form is used here to generate the bytevector from a -base-32 string. +base-32 string. You can obtain this information with @code{guix +download} (@pxref{Invoking guix download}) or @code{guix hash} +(@pxref{Invoking guix hash}). @item @code{file-name} (default: @code{#f}) The file name under which the source code should be saved. When this is @@ -4533,6 +4535,11 @@ 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. +The same is true for other version control checkouts (@code{rm -r .hg}, +@code{rm -r .svn}, etc.) + @end table @node Invoking guix import -- 2.1.4