From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kAX3GELry2KNegAAbAwnHQ (envelope-from ) for ; Mon, 11 Jul 2022 11:20:02 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4NDMGELry2JYvgAAauVa8A (envelope-from ) for ; Mon, 11 Jul 2022 11:20:02 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1A5933AA59 for ; Mon, 11 Jul 2022 11:20:02 +0200 (CEST) Received: from localhost ([::1]:35856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oApaD-0000hU-0z for larch@yhetil.org; Mon, 11 Jul 2022 05:20:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oApZm-0000hD-Th for help-guix@gnu.org; Mon, 11 Jul 2022 05:19:35 -0400 Received: from mout02.posteo.de ([185.67.36.66]:53909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oApZg-0005og-RN for help-guix@gnu.org; Mon, 11 Jul 2022 05:19:34 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A0B5824010D for ; Mon, 11 Jul 2022 11:19:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1657531166; bh=nlWnB2hd0xSAsO/yPiuQYhoBZMnk2dx7oVJxGNs6Odo=; h=Date:Subject:To:Cc:From:From; b=IuCWY9PqeBpqjEUCrjYx4dXQuep7XMowMSAbRLP0eE6JomRzQr+UskJMHAnhvmMEi T0RVpZwy91VItPykjp69qLjY24td3W2V42OIgSCefKhwS8EtlCsZKh/Oyb0Fhz7fe8 bACxgTUtIJAXpRzsdMIHgLGOMW5xW46MlRMj8rwtMqoL33bPnG/SiLblhUAM7duGFG hFh2vH0215Q7xDHKiwvbUi+Vux9fzSLMXgNW6oP8RdWon2w+a5lGLcS+pcevlDe4ts 1+kp+MTYBZi2qfOvhooY/Sz7kQ7pHfP1KhL2tuQBGh+pHgdFHRmYkEiwrYlktVbfYt S1ASnhEp/x/rw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LhJHK60Wsz9rxF; Mon, 11 Jul 2022 11:19:25 +0200 (CEST) Message-ID: <500e3084-71dd-12b3-bf37-8cc8bc47abb0@posteo.de> Date: Mon, 11 Jul 2022 09:19:25 +0000 MIME-Version: 1.0 Subject: Re: Package definition hash calculation Content-Language: en-US To: Julien Lepiller References: <54cbdaf2-f1ef-7490-7c2a-05f63edf7d56@posteo.de> <764ABCE7-B46B-49A7-8C6F-0892BAA8C48B@lepiller.eu> Cc: help-guix From: Zelphir Kaltstahl In-Reply-To: <764ABCE7-B46B-49A7-8C6F-0892BAA8C48B@lepiller.eu> Received-SPF: pass client-ip=185.67.36.66; envelope-from=zelphirkaltstahl@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657531202; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=L0/5saGvK0BLOzKktJP8A1b+gmZARq9WWAwcogcm7k4=; b=jPJYllau/wr69+qkXLCFbGovaggJXvpbkdCpEKPxoghIp+dWaxHKe8FqQAbajjvwUn/TIw DezV005qy27RM77FFbD3RGHvcQDc081+Q8/QB+P13RcK4kr013jlzmRME7Aacw/WRoNMP9 9FnMHs7sYjzUU96UUilclj6S5qF+NygYs7Zj+c7jInwS1uZi74ABALkr8jWjmnV0b/Vz9P OtLlwP/TMTVFp+apCx/e2lR/e2FJf01pl81pvoNs4kFc9qjTPgTi4CH5IQHq+mP4BqKyAE D6c8GpqjiMHZYpUEsz9QMExsfjvBzqBdlMZvs/MaddSBx+WFhHBG3mXRSI8lXQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657531202; a=rsa-sha256; cv=none; b=jQMdx3vLTDxZUUrtc66k5dBCiaE5H4UzpNdiegmDqXSOSXGMmimV+ITp0CwX+jW9F+a7kr W6Jmz1PelZI28QYF0zY+0DlJJzhIBXoTKlWmVLvATjehGvNMm0aXhPwtMc6ceRar0drr0W GGagzFxIlZ0orcLU7POIoc5PLSzkqjC23Wne8twenMUiHmycmD1fMIjF1uO162d2ActYSs QLxD7EJAuQrZnCiEHzxs0Q541XfGd82vmx28uZ6HFNwbP8JAwe4ruHPDZSN6QIIjCD1INp Z+i0VuOnWN8gETDUdEvZnGAWYOyIlgTaxxUEjq5dbs4BDc1xRdpsOeR3QIELbQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=posteo.de header.s=2017 header.b=IuCWY9Pq; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.de (policy=none); spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.75 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=posteo.de header.s=2017 header.b=IuCWY9Pq; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.de (policy=none); spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1A5933AA59 X-Spam-Score: 5.75 X-Migadu-Scanner: scn0.migadu.com X-TUID: JPuDkA6V4cc3 Hello Julien! I did create the release tag on the latest commit, which was also the master branch. I thought there was some clever trick to get Guix to ignore the `guix.scm` file, when calculating the hash sum, but apparently that is not the case. I still wonder how I made the first version of the package though. I did not know about `git-checkout` as `source` method. Thanks for that! I am unsure, whether my project must have a `guix.scm` file or not, to be a valid Guix package in the end, when I add it to (update the entry in) `gnu/packages/guile-xyz.scm`. Maybe a `guix.scm` in the project is not even needed. Anyway, the idea makes sense to track the master using a checkout without a hash sum, so that I don't have the problem of the hash changing any longer. Just not sure it will work for updating the package in guix. I will try it. There is no information about `git-checkout`: https://guix.gnu.org/manual/en/html_node/origin-Reference.html Is it elsewhere in the docs? Best regards, Zelphir On 7/9/22 13:44, Julien Lepiller wrote: > When you use guix download, or url-fetch, the hash is computed over the entire > file, whether it's a tarball that contains other files or whatever else > doesn't matter. You can't exclude files from inside the tarball. It's just the > checksum of the file. > > What you describes sounds like you're downloading a tarball that's generated > from your master instead of a particular commit. So everytime you push a > change to guix.scm, it's a new commit and a different tar.gz (different > checksum). So you're always chasing after the correct checksum, which won't work. > > So you can have a guix.scm in your repo, but it can't refer to a generated > tarball from master. Instead, you could make it refer to master and not have > to provide a hash like so: > > (source (git-checkout (url "https://…"))) > > No more chasing afcer master :) > > On July 9, 2022 1:09:27 PM GMT+02:00, Zelphir Kaltstahl > wrote: > > Hello Guix users! > > I feel a bit stupid to ask about this topic again, however, to me it is not really clear, what I need to do, when calculating the hash of a package, so that I can write it in the package definition. > > I have a project (https://notabug.org/ZelphirKaltstahl/guile-fslib), which I have packaged before, but that was already a year ago or so, and I forgot the precise process involving the hashes. > > I have the following questions: > > (1) When I edit the `guix.scm` file and change the hash in there, make a tarball release on notabug, and then run `guix download `, I get a new hash. If I edit the guix.scm file again and repeat the process, I get a new hash … endless loop of getting a new hash and changing the file accordingly. My guess is, that this is, because `guix download` does not exclude the `guix.scm` file. I would have to manually make a `tar.gz` and upload that as a release to notabug and then reference that. – Is this correct? > > (2) I guess I should be using `guix hash --exclude-vcs --serializer=nar --format=??? .` instead, since my package definition makes use of the `git-fetch` method of fetching the package. I had totally forgotten about this, until I searched in old e-mails, reading old replies to previous questions I asked on this mailing list. I think it could be made clearer in the docs, which command to use in which case. However, now I am not sure which `--format=` I should use. I would guess `base32`, because in my package definition it says `(sha256 (base32 "..."))`. Is this correct? Or is the default fine? > > (3) What is the recommended way to update a package's source code and then "in one go" calculate the hash, update the `guix.scm` and make a proper release, which only has the appropriate files in the tarball? > > (4) Should a release tarball contain a `guix.scm` package definition? (My guess is not, since the hash in that file changes and that would change the tarball. Maybe I am overlooking things/magic though.) > > I am feeling like I am stuck in what should be a simple process, because I still have some points that are unclear to me. I try updating my guide to packaging a pure Guile package when I learn new things, so that I can read up next time I want to make a release or a new package, but a few things are still missing or unclear. > > Thank you for all your help! > > Best regards, > Zelphir > > -- repositories: https://notabug.org/ZelphirKaltstahl > -- repositories:https://notabug.org/ZelphirKaltstahl