From mboxrd@z Thu Jan 1 00:00:00 1970 From: ng0 Subject: Re: guix hash of source from git repository. Date: Tue, 21 Feb 2017 21:56:29 +0000 Message-ID: <20170221215629.wqrvnhsmr4l5q7zs@wasp> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIOH-0004jX-T6 for help-guix@gnu.org; Tue, 21 Feb 2017 16:54:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgIOE-0006th-0l for help-guix@gnu.org; Tue, 21 Feb 2017 16:54:33 -0500 Received: from latitanza.investici.org ([2001:888:2000:56::19]:40990) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgIOD-0006tF-NP for help-guix@gnu.org; Tue, 21 Feb 2017 16:54:29 -0500 Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Catonano Cc: Dmitry Nikolaev , help-guix On 17-02-21 22:25:35, Catonano wrote: > Hi Dmitry, > > 2017-02-21 22:19 GMT+01:00 Dmitry Nikolaev : > > > When writing package definition, what if I download sources from git > > repository? For example: > > > > (define-public libwebsockets > > (package > > (name "libwebsockets") > > (version "1.3") > > (source (origin > > ;; The project does not publish tarballs, so we have to take > > ;; things from Git. > > (method git-fetch) > > (uri (git-reference > > (url "git://git.libwebsockets.org/libwebsockets") > > (commit (string-append "v" version > > "-chrome37-firefox30")))) > > (sha256 > > (base32 > > "12fqh2d2098mgf0ls19p9lzibpsqhv7mc5rn1yvrbfnazmcr40g4")) > > (file-name (string-append name "-" version)))) > > ... > > > > How do I calculate this 12fqh2d...? > > > > Dmitry Nikolaev > > > > You clone the git repository locally, then you use 'guix hash' as explained > in this page of the manual (the option you want to use is "--recursive") > > https://www.gnu.org/software/guix/manual/html_node/Invoking-guix-hash.html Please avoid doing the way described below though. Calculating it in advance is more secure and helps to prevent introducing errors. If there's a mismatch it shows an error. > Another option is to try to build the package with the wrong hash, wait for > the error message and copy the right hash from within the error message > itself. Lame, but hey > > Hope this helps ! > > Ciao