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 ONAlBExuyWJBDAEAbAwnHQ (envelope-from ) for ; Sat, 09 Jul 2022 14:02:20 +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 gALyA0xuyWJCZgEAauVa8A (envelope-from ) for ; Sat, 09 Jul 2022 14:02:20 +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 B314127BF2 for ; Sat, 9 Jul 2022 14:02:19 +0200 (CEST) Received: from localhost ([::1]:39200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oA8uZ-00048t-CN for larch@yhetil.org; Sat, 09 Jul 2022 07:46:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oA8u4-00048e-E0 for help-guix@gnu.org; Sat, 09 Jul 2022 07:45:40 -0400 Received: from lepiller.eu ([89.234.186.109]:41298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oA8ty-0003Mu-Mf for help-guix@gnu.org; Sat, 09 Jul 2022 07:45:38 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 6c95a760; Sat, 9 Jul 2022 11:44:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=sKjJTqH3UvwQ RRd/LwmqJ/mZGvG1gEmn/HxnKIQnnsI=; b=ZrD1xQD5wxU9dpj8gll5lzTwCuFp XqSE1Oa0l0swVD735ehZZScPDqR8bJ+3XMZ1huwHOodGn7Et/OYyUNvhR5/YYTs8 /hgXXAdPxEtbg+Tcb4uBz54jeAN0fFc0clit+h28ZDnUplxgaKxywzTgRw01XEkN Wc725HLyfu7xnqvabo/O6qqI7VJSZGGCWWMbOFRkrU894pqe4DRqLg7hjikRLsot XXGkiXbacGlljFPjPlxEIdtKXEZSdq3NHhN234HRt8vNnxqDxgydFmjSkCgYThxc Kx9c5kaNNaRBb2a5KfWlqe/Qp86lki39N2XMWYIQKJSfaTjImHo/HkKURA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 781c6b6a (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sat, 9 Jul 2022 11:44:27 +0000 (UTC) Date: Sat, 09 Jul 2022 13:44:24 +0200 From: Julien Lepiller To: help-guix@gnu.org, Zelphir Kaltstahl , help-guix Subject: Re: Package definition hash calculation User-Agent: K-9 Mail for Android In-Reply-To: <54cbdaf2-f1ef-7490-7c2a-05f63edf7d56@posteo.de> References: <54cbdaf2-f1ef-7490-7c2a-05f63edf7d56@posteo.de> Message-ID: <764ABCE7-B46B-49A7-8C6F-0892BAA8C48B@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=1657368139; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=8I0CEes6sObBEF8Tt0zTre9BjuRjTLb+ODYikADfpbM=; b=SPG/9RptLgoZJt4I9rYBMKI3s0jhi2BlSBZD1SOGbJEZVqjXe4/lclWqVlWQ/LsPo2nAiu oip1GONmwONyUbRAEaHqpagd6Zqg+rsF/8Bp3i0uvt358DrTvK1YO56bgO4r9WZKZAGC5L 5rW+e8qgqcqvEv7aRCQhGdo7tS3ezuD2yDdJ/dlBWioTRIOX2NhdPHygFnihysRpDptfDl syxfJTpCPdbuFKH8YhMeT+lExnjYw94s1NY/gl5z4oMWMykK/0c/mejUo60SWjOMbXMiiU VXQNyBIIlGsEXGJ9q9q2RBWv5m62MuFnlgDiTZ5m2WXYuBydZwjQqgy3PaH1FA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657368139; a=rsa-sha256; cv=none; b=kemSiDlHzSiAROKJI21FZiyWIhJy1pb3whwELlIkT2Y4553/buFyOCoDTRgXwBfVaBOdN1 fjQoduO+Wr3qpvg8dajSr8Cs1J4jmJvdrrMEh7TGAmj/iP3K42FAeJv5fnhVAEsD48l+Qb umVKmtZYWGPAjFsmVy11Ajasvx+rjrfZKdnA0C2UW++mNqyaUejKMx9xI0p/LKhOR1vg6n hW6HT/JSvjre3vJY/gG3BHDBisb0AjQIq0Xgv+edhHPBp9MbmP5ouE6L9rcaKkDKhii9UV +btYXTjuTohn/EyiXxM7wMweub3DebEXFL5HxBokcu2L448fa83AqFaAoL9P+g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=lepiller.eu header.s=dkim header.b=ZrD1xQD5; 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: 5.15 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=lepiller.eu header.s=dkim header.b=ZrD1xQD5; 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: B314127BF2 X-Spam-Score: 5.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: H6QNpIHzBajD When you use guix download, or url-fetch, the hash is computed over the ent= ire 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 It's = just the checksum of the file=2E What you describes sounds like you're downloading a tarball that's generat= ed from your master instead of a particular commit=2E So everytime you push= a change to guix=2Escm, it's a new commit and a different tar=2Egz (differ= ent checksum)=2E So you're always chasing after the correct checksum, which= won't work=2E So you can have a guix=2Escm in your repo, but it can't refer to a generat= ed tarball from master=2E Instead, you could make it refer to master and no= t have to provide a hash like so: (source (git-checkout (url "https://=E2=80=A6"))) 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 n= ot really clear, what I need to do, when calculating the hash of a package,= so that I can write it in the package definition=2E > >I have a project (https://notabug=2Eorg/ZelphirKaltstahl/guile-fslib), wh= ich I have packaged before, but that was already a year ago or so, and I fo= rgot the precise process involving the hashes=2E > >I have the following questions: > >(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 repeat th= e process, I get a new hash =E2=80=A6 endless loop of getting a new hash an= d 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 manual= ly make a `tar=2Egz` and upload that as a release to notabug and then refer= ence that=2E =E2=80=93 Is this correct? > >(2) I guess I should be using `guix hash --exclude-vcs --serializer=3Dnar= --format=3D??? =2E` instead, since my package definition makes use of 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 previous que= stions I asked on this mailing list=2E I think it could be made clearer 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 in my p= ackage definition it says `(sha256 (base32 "=2E=2E=2E"))`=2E Is this correc= t? Or is the default fine? > >(3) What is the recommended way to update a package's source code and the= n "in one go" calculate the hash, update the `guix=2Escm` and make a proper= release, which only has the appropriate files in the tarball? > >(4) Should a release tarball contain a `guix=2Escm` package definition? (= My guess is not, since the hash in that file changes and that would change = the tarball=2E Maybe I am overlooking things/magic though=2E) > >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=2E I try updating my guide = to packaging a pure Guile package when I learn new things, so that I can re= ad up next time I want to make a release or a new package, but a few things= are still missing or unclear=2E > >Thank you for all your help! > >Best regards, >Zelphir > >--=20 >repositories: https://notabug=2Eorg/ZelphirKaltstahl > >