From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kDutDjj5y2J4swAAbAwnHQ (envelope-from ) for ; Mon, 11 Jul 2022 12:19:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oKhODjj5y2IftwAAauVa8A (envelope-from ) for ; Mon, 11 Jul 2022 12:19:36 +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 EBE09389E3 for ; Mon, 11 Jul 2022 12:19:35 +0200 (CEST) Received: from localhost ([::1]:51768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAqVr-0000EN-5D for larch@yhetil.org; Mon, 11 Jul 2022 06:19:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAqV4-0000AD-7U for help-guix@gnu.org; Mon, 11 Jul 2022 06:18:46 -0400 Received: from lepiller.eu ([89.234.186.109]:41536) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAqV0-0000fQ-Nu for help-guix@gnu.org; Mon, 11 Jul 2022 06:18:45 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id faadfcc8; Mon, 11 Jul 2022 10:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=o9KIjvx0GzLa oVHKApdSAh0nNOE9ayeaglTQwYOUnAo=; b=jKss56V7sBjbG/RRpo9J50EBr23B MWmMEHEM2VobF9r10iWbQMOmtXG8UuPuclxVGuaSm4O3KLiJjcIbgyS5brhkMMhS 5ljPuVQu/X40n9dVfp0k7Lq7qhtYrH7Yl1+Jfqv9BA2guTqx/Z2t8hOrcq07XgB5 KlRSfYYQKRTYtWK7CyigkasMu9X/6Z5+JSL3dFHdFidTO/kWpCD56rxu/QQUj0js 6eEGxa/Wissi9LCiZyXOq3Y3H16IPTBryQOtlPuigchm7X7Vc8Kt18esFjwkTnkY FyRWyvYbsGcCjqNL93b65hsXi/YzM/qCDCzhA39QnMMWTtfPHb5He8YQRw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id a46a9f77 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 11 Jul 2022 10:18:37 +0000 (UTC) Date: Mon, 11 Jul 2022 12:18:34 +0200 From: Julien Lepiller To: Zelphir Kaltstahl CC: help-guix Subject: Re: Package definition hash calculation User-Agent: K-9 Mail for Android In-Reply-To: <500e3084-71dd-12b3-bf37-8cc8bc47abb0@posteo.de> References: <54cbdaf2-f1ef-7490-7c2a-05f63edf7d56@posteo.de> <764ABCE7-B46B-49A7-8C6F-0892BAA8C48B@lepiller.eu> <500e3084-71dd-12b3-bf37-8cc8bc47abb0@posteo.de> Message-ID: <96C11B7F-4808-4EAB-858B-D6E22BA566C4@lepiller.eu> MIME-Version: 1.0 Received-SPF: pass client-ip=89.234.186.109; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-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 Content-Transfer-Encoding: quoted-printable 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=1657534776; 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=wFikSl8/Rahy0NV2BJIW54RXO5w69D/PCa+WNvf7heA=; b=X+u9L5KQXSlUhrdt3wrZbStaa9VSLfU2hc7pMz3pjIZaRg3hJJJRymNvmzrekPTwDDK1sc DQNorhaiEG2fJqPKBmcxrY0BKJMZfh+tjhmbgDQmK8rOBVeCrUDFniD0/UbFGIYbgb1Fv+ gWDNC944tdC3tIunDOg5+DAhbdwKDFrOCaO/9z9JvTVm5wlb42pQTajkur2IiM9Hi6k5dO UuxShXGUUf7sWuQJ5qTIc6ipSYmrufUHh7M+VpVw9UqsZHmI/2VuXMHEpKFAlEFp/kr60K cLMc+g3LGG15DrjySO341+fNF/F5HgLP7Es8Bj9Cx0R3CungsQ72jEww+Ppe8g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657534776; a=rsa-sha256; cv=none; b=dBrteUOD7pBTJx/iVwJPPgE+sJXvnSrii0oKurwLZvpDAzwj5PQ2kT1u45srkcQ1NXPGcB e1DkjJBVnbRsA7OY5VfGO868Md8MgTGFm0R4INyGi3WVTVEdrfl8rkRCveitPi1ZygJHf7 ienWKWPtg1T3hsk+/3yqZhywpImkmCqUU0Dna5GJY8VEdRxVVkOL5fBEsQkonFWOSsrMB9 DSVS05J0coVQibidq5aBj15R04yf02sG1Gvo18PZ+PT49O7kuuzukQMjAoBEwk6TAwIMzE EzELNryQ76JaRJAjAaND2KJo0CZMYEVc4W2C1ipJGMOcLZXqqrBmml98UOfmLw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=lepiller.eu header.s=dkim header.b=jKss56V7; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (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: 6.25 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=lepiller.eu header.s=dkim header.b=jKss56V7; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (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: EBE09389E3 X-Spam-Score: 6.25 X-Migadu-Scanner: scn1.migadu.com X-TUID: nNYr3q7fMLnd I don't think it's documented=2E I use guix=2Escm in my projects, so it's supported=2E I don't understand y= our issue with the hash then, because now it sounds that you're cloning the= same commit everytime, so how do you get a different hash? Le 11 juillet 2022 11:19:25 GMT+02:00, Zelphir Kaltstahl a =C3=A9crit=C2=A0: >Hello Julien! > >I did create the release tag on the latest commit, which was also the mas= ter branch=2E I thought there was some clever trick to get Guix to ignore t= he `guix=2Escm` file, when calculating the hash sum, but apparently that is= not the case=2E I still wonder how I made the first version of the package= though=2E I did not know about `git-checkout` as `source` method=2E Thanks= for that! > >I am unsure, whether my project must have a `guix=2Escm` 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=2Escm`=2E Maybe a `guix=2Escm` in the project is no= t even needed=2E > >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 long= er=2E Just not sure it will work for updating the package in guix=2E I will= try it=2E > >There is no information about `git-checkout`: https://guix=2Egnu=2Eorg/ma= nual/en/html_node/origin-Reference=2Ehtml 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=2E You can't exclude files from inside the tarball=2E I= t's just the checksum of the file=2E >>=20 >> What you describes sounds like you're downloading a tarball that's gene= rated from your master instead of a particular commit=2E So everytime you p= ush a change to guix=2Escm, it's a new commit and a different tar=2Egz (dif= ferent checksum)=2E So you're always chasing after the correct checksum, wh= ich won't work=2E >>=20 >> So you can have a guix=2Escm in your repo, but it can't refer to a gene= rated tarball from master=2E Instead, you could make it refer to master and= not have to provide a hash like so: >>=20 >> (source (git-checkout (url "https://=E2=80=A6"))) >>=20 >> No more chasing afcer master :) >>=20 >> On July 9, 2022 1:09:27 PM GMT+02:00, Zelphir Kaltstahl wrote: >>=20 >> Hello Guix users! >>=20 >> I feel a bit stupid to ask about this topic again, however, to me i= t is not really clear, what I need to do, when calculating the hash of a pa= ckage, so that I can write it in the package definition=2E >>=20 >> I have a project (https://notabug=2Eorg/ZelphirKaltstahl/guile-fsli= b), which I have packaged before, but that was already a year ago or so, a= nd I forgot the precise process involving the hashes=2E >>=20 >> I have the following questions: >>=20 >> (1) When I edit the `guix=2Escm` file and change the hash in there,= make a tarball release on notabug, and then run `guix download `, I get a new hash=2E If I edit the guix=2Escm file again and rep= eat the process, I get a new hash =E2=80=A6 endless loop of getting a new h= ash and changing the file accordingly=2E My guess is, that this is, because= `guix download` does not exclude the `guix=2Escm` file=2E I would have to = manually make a `tar=2Egz` and upload that as a release to notabug and then= reference that=2E =E2=80=93 Is this correct? >>=20 >> (2) I guess I should be using `guix hash --exclude-vcs --serializer= =3Dnar --format=3D??? =2E` instead, since my package definition makes use o= f the `git-fetch` method of fetching the package=2E I had totally forgotten= about this, until I searched in old e-mails, reading old replies to previo= us questions I asked on this mailing list=2E I think it could be made clear= er in the docs, which command to use in which case=2E However, now I am not= sure which `--format=3D` I should use=2E I would guess `base32`, because i= n my package definition it says `(sha256 (base32 "=2E=2E=2E"))`=2E Is this = correct? Or is the default fine? >>=20 >> (3) What is the recommended way to update a package's source code a= nd then "in one go" calculate the hash, update the `guix=2Escm` and make a = proper release, which only has the appropriate files in the tarball? >>=20 >> (4) Should a release tarball contain a `guix=2Escm` package definit= ion? (My guess is not, since the hash in that file changes and that would c= hange the tarball=2E Maybe I am overlooking things/magic though=2E) >>=20 >> I am feeling like I am stuck in what should be a simple process, be= cause I still have some points that are unclear to me=2E 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=2E >>=20 >> Thank you for all your help! >>=20 >> Best regards, >> Zelphir >>=20 >> -- repositories: https://notabug=2Eorg/ZelphirKaltstahl >>=20 >--=20 >repositories:https://notabug=2Eorg/ZelphirKaltstahl