From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mFUgLpNcfWHwJQEAgWs5BA (envelope-from ) for ; Sat, 30 Oct 2021 16:54:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id WOLIKZNcfWG9NQAAB5/wlQ (envelope-from ) for ; Sat, 30 Oct 2021 14:54:11 +0000 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 7E5871A26 for ; Sat, 30 Oct 2021 16:54:11 +0200 (CEST) Received: from localhost ([::1]:34854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgpkI-0001hs-NV for larch@yhetil.org; Sat, 30 Oct 2021 10:54:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgpkA-0001hV-Sw for guix-patches@gnu.org; Sat, 30 Oct 2021 10:54:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgpkA-0008TU-Kf for guix-patches@gnu.org; Sat, 30 Oct 2021 10:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgpkA-00043H-Dr for guix-patches@gnu.org; Sat, 30 Oct 2021 10:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51307] [PATCH 0/2] guix hash: eases conversion Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 30 Oct 2021 14:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51307 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 51307@debbugs.gnu.org Received: via spool by 51307-submit@debbugs.gnu.org id=B51307.163560560615521 (code B ref 51307); Sat, 30 Oct 2021 14:54:02 +0000 Received: (at 51307) by debbugs.gnu.org; 30 Oct 2021 14:53:26 +0000 Received: from localhost ([127.0.0.1]:58142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgpjZ-00042H-OX for submit@debbugs.gnu.org; Sat, 30 Oct 2021 10:53:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgpjY-000425-D7 for 51307@debbugs.gnu.org; Sat, 30 Oct 2021 10:53:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55006) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgpjT-0008R4-20; Sat, 30 Oct 2021 10:53:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=S9PEHJ4sYAlFwxKInelHg1Pou2XCJLRkkRRanF7T+Jw=; b=nyIXtGDhb+Yyq87ZpBcL 9a+QSvHJNK+nlOc6t1MzzP5DHvjXt4waSGAXWpRc+ihzBnGjLZMHTCwXmiLA4wPjqV399asMy1fRX NVaMWuqG7f2QnLjm2CgfB0/vBrQAzeClDwROP3NTKxA7K67ju7dElulEIwfw1oE3oKjhja4LsfOnu yHHnHGqwHUSSBi2F/JNVXjA2E1AQ+Un6DWnCKFccmu8bOinOoHexlChL6VToI0SL1+yDnwjOSyBBa 2tnXtcbrP8da7HTkULSolcEG0fwAKnTt0CBy/1JDxrWk4WSfAA7Go6yNH14gjYEgVE4mjoV87HM6x PwBkQ+ZW7MxMpA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55428 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgpjS-0002ac-HQ; Sat, 30 Oct 2021 10:53:18 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211020165020.3358311-1-zimon.toutoune@gmail.com> Date: Sat, 30 Oct 2021 16:53:17 +0200 In-Reply-To: <20211020165020.3358311-1-zimon.toutoune@gmail.com> (zimoun's message of "Wed, 20 Oct 2021 18:50:20 +0200") Message-ID: <87wnlusgwy.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635605651; 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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=S9PEHJ4sYAlFwxKInelHg1Pou2XCJLRkkRRanF7T+Jw=; b=Hwm5mmo/Whk9rgzmbxgWmtsdpbB3uo7SgwIUGh7xSTCyb506ZgMkqMatjZ1f8z9wyimcA1 kiM5Y2kvMNBi88MGPyOvQtBmWsdVq/jw4HWNKudqWT4uPj4Cg5Cd554z01T5A68xHYMe76 fGc1UjSNWrg/AS2e4DLSuqLw8HFT4Cgh9MynN7CfsV6hIr0Ws4HL3YOUpi8BHnfbJ8rnSF wfh0nMltOoHfT/YBGN9Y6gQY3R9Cs/R/0nXeRZhqO+SnPXIZs1uhzMeGISAGT8LW82pns4 EEr2BrN4lvSDfJpcEzOoOFDjIHxzHXAG16zQFEGbqpVnX8WBypxXxPyjsVP28g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635605651; a=rsa-sha256; cv=none; b=l8j4w0VZal6Ew+qvIyZXI2P7f9rYdzqPuOhExxiAP9SpcWGVUABKDJ5+0z1gIUwLoz4hcZ auEOmcFcmhLapxqf+m62IH0MsQs7BWc1YnZyykUi6ZFF6Tlip/reQ2WV+x5bB+dwyX+g4r ojs2kkKfdo5oaBHkwYEQoCSJUhC7P4ZL44vk/FkPfEyoFaU0bnL85A/FoNVQD8DN9obIUd nO0eMDWvPk2ty5i4X9FweDW1MCDteclF8yNUif6VYRC+A6UyAMQS22Yzo69Z35bcIC/BIO X2u/afUVSZzVVnv6F5H295OWrQyhw9ut6hVZ1b3w4/pxif4KqNbjuwJiC+Mp6g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nyIXtGDh; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nyIXtGDh; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 7E5871A26 X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0IokoiXRckkl Hi, zimoun skribis: > 2. Using the option recursive changes the result for tarball, as with: > > $ guix hash $(guix build hello -S) > 0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i > > $ guix hash $(guix build hello -S) --recursive > 1qx3qqk86vgdvpqkhpgzq3gfcxmys29wzfizjb9asn4crbn503x9 > > And I am not able to imagine a case. To me, it should be a fixed-poi= nt. > That=E2=80=99s what the first patch correct. That=E2=80=99s expected: =E2=80=98--recursive=E2=80=99 uses a different com= putation method, including file metadata (technically, it serializes the file as a nar and computes the hash of the nar). [...] > Then, working on Disarchive which uses base16 as encoding, it is annoying > twice, > > a) because it requires to download when all the sources > b) because it sometimes requires to apply patches > > Compare, > > $ guix hash $(guix build ceph -S) > 0ppd362s177cc47g75v0k27j7aaf27qc31cbbh0j2g30wmhl8gj7 > > with the checksum in the package definition: > 0lmdri415hqczc9565s5m5568pnj97ipqxgnw6085kps0flwq5zh. > > With the second patch, it becomes easy to convert the checksum from upstr= eam: > > $ ./pre-inst-env guix hash ceph -f base16 > f017cca903face8280e1f6757ce349d25e644aa945175312fb0cc31248ccad52 > > and nothing is downloaded. Get the checksum of what Guix really builds is > done via the current way, for instance, > > $ guix hash $(guix build ceph -S) -f base16 > 473e4461e5603c21015c8b85c1f0114ea9238f986097f30e61ec9ca08519ed5e > > and the second patch allows to convert the checksum from the package > definition (without downloading). Ah yes, got it. (I should read messages in the right order, oops!) An obvious problem with the interface you propose is that it=E2=80=99s ambiguous: are you printing the hash of the =E2=80=98ceph=E2=80=99 package,= or computing that of the =E2=80=98ceph=E2=80=99 file? I=E2=80=99m sure the Zen of Pytho= n has something on ambiguity. ;-) Do you think there=E2=80=99s another place where we could provide helpers f= or the die-hard Disarchive hackers among us? Maybe we could get =E2=80=98guix= lint -c archival=E2=80=99 to print Disarchive URLs upon failure, and that=E2=80= =99d already help? WDYT? Thanks! Ludo=E2=80=99.