From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OFtxBeFmfWG6OQEAgWs5BA (envelope-from ) for ; Sat, 30 Oct 2021 17:38:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id QIgnAeFmfWGoCwAA1q6Kng (envelope-from ) for ; Sat, 30 Oct 2021 15:38:09 +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 C05F4B694 for ; Sat, 30 Oct 2021 17:38:08 +0200 (CEST) Received: from localhost ([::1]:47612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgqQp-0004En-FV for larch@yhetil.org; Sat, 30 Oct 2021 11:38:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgqQl-0004C0-0J for guix-patches@gnu.org; Sat, 30 Oct 2021 11:38:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46633) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgqQk-0006WT-NY for guix-patches@gnu.org; Sat, 30 Oct 2021 11:38:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgqQk-0005JN-B6 for guix-patches@gnu.org; Sat, 30 Oct 2021 11:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51307] [PATCH 0/2] guix hash: eases conversion Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 30 Oct 2021 15:38: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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 51307@debbugs.gnu.org Received: via spool by 51307-submit@debbugs.gnu.org id=B51307.163560827420397 (code B ref 51307); Sat, 30 Oct 2021 15:38:02 +0000 Received: (at 51307) by debbugs.gnu.org; 30 Oct 2021 15:37:54 +0000 Received: from localhost ([127.0.0.1]:58179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgqQc-0005Iv-FU for submit@debbugs.gnu.org; Sat, 30 Oct 2021 11:37:54 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:40729) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgqQb-0005Ij-G4 for 51307@debbugs.gnu.org; Sat, 30 Oct 2021 11:37:53 -0400 Received: by mail-wr1-f47.google.com with SMTP id r8so8592028wra.7 for <51307@debbugs.gnu.org>; Sat, 30 Oct 2021 08:37:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=RE6aTBKB+2nvnVDyUkiurUGvR+9PpCZRQ1Prmaz5wsQ=; b=DQDKTNeBc+rGru29wTkOyT8kbThtd3660ZdTGYGdDNcIKEhFInsYOWma08CH4v53DQ RLK0uQP6214ieJTShRViUwhlhZLci0pRgOI9MAeCaKeIn6h+vWV8f1TWq2rdMqATt8bt O8ljIvmgKzxsOTIAUTVy59kZuRciNU88N/R7HTN+BfEiRXIS603mFS7stPHZvpgbB8yl hQAePLBjhRKcKWYG3c/ziWQbr9+isiCB+i6cxc5scb+jVxesAPrb+/YajtUzS13WXQvV JeY0x5Jj5NaqUjj7T6Z8mmxbMbBFsO3Ys8VYc5ebzlWuTN5SXdM4emf0tU7k50EEh6A/ 5LTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=RE6aTBKB+2nvnVDyUkiurUGvR+9PpCZRQ1Prmaz5wsQ=; b=BDsxczh99NUgRAM8VNbrt4AVTdtGK/kBBRqgpknS/c590w1IdeJVXWlsXvLyMCeiu/ w7O1RBqTC+ODyTqhgSx4WbyidHnVoc8ey+gbwTo/KJeP69BBOH6ajMNGzpZv3ZtVPV2C 4h1PKqo5bxxU/hQXYmiM5oScar0aCvrPtoc4ZVwSDFYKbQrf2oSB5AR0xE/I/xgt232h fGP9DISdwM7dGyuyWQf0xUoYDrK8GMRlgxK0Iwh4RnSy/ynfqr7p3Dql2J/Q5iPKp1ao DaNypyut1GZLxnBLjoJRc1oVYixE4kuFrD14xEXbEutU69j+Zt0/ymkS04svXqJgr9B6 x/QA== X-Gm-Message-State: AOAM533rk58llJidB7jz8WYR0Bjk0ONseofdoVsHLdZl2lLz9DepzyDH Ud1DNiC/G+tC8X3rHVoSNT+xPIUUu58= X-Google-Smtp-Source: ABdhPJzv8THvNJoCTYIpOEzaWt1n4GO7VSRrvrSvs+j/ZJNAz4oGdRfDo+8o+wdXWpMZnB0/BSaILQ== X-Received: by 2002:adf:ec45:: with SMTP id w5mr8732272wrn.183.1635608267592; Sat, 30 Oct 2021 08:37:47 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id 13sm11646601wrz.38.2021.10.30.08.37.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Oct 2021 08:37:47 -0700 (PDT) From: zimoun In-Reply-To: <871r42tvoy.fsf_-_@gnu.org> References: <20211020165435.3358398-1-zimon.toutoune@gmail.com> <20211020165435.3358398-2-zimon.toutoune@gmail.com> <871r42tvoy.fsf_-_@gnu.org> Date: Sat, 30 Oct 2021 17:34:55 +0200 Message-ID: <86h7cyle5c.fsf@gmail.com> 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=1635608288; 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=RE6aTBKB+2nvnVDyUkiurUGvR+9PpCZRQ1Prmaz5wsQ=; b=blllT55/U0aXHJIPmz7COYIYcScN2Yo0Xo8vd5UdWvryqTP3BtwbGKNpAwrt3GBzBCGsNq w0ev3hsVgnxdMXzdtoIauJLQGl1qnXOGNGorKYyfnd9eIUOcvspfN9LYaawmkBNGHAmY3+ zC/KnzeOgyns8KSZ9or2TIZYaa68OOcaCAQYePNbRdbWEBVvy0qTjQJZYLw96Ao4ykCaPd 0exEPvYMzgaqrRaAV8a0mE7qJNxYRpG0eRZba4Yss2AA7Q0J9OG7zzAC9HGN8h+CXstma6 BTdRKwjIjUZkkwJv64Z2RpG3KblsPt3tA5jhD9OQ5FhZxkpZa+pzVcEOIPdgJg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635608288; a=rsa-sha256; cv=none; b=h2FPc1BlOb7/diSz8Yv0kYILkSkdInmRWPvpU/GgyoOihktts0wX9Pqqz1IHAtI4HTl2UY ZfelOFf9rDEtzMkZN8iwp3LYiYoxBxtFX22Ut21Cnypwnq9MiQC+MXtWdszFD1PYcDvFG3 yD2JX+XM/L6IhwJXpOjJeakmUMQofWhRQIG9iNpVsikyvrUCvqdbfGW60fbophZ0w/7SyV t5UNa5guRZHRrBx5o+cHtHGd5+rliWTanPPqfzxfUAmNHcc+veL8c1hIGPWwoEniuLb+Ol uCsqH6Dk8UkaE6fd+H8mxqsSjvH9oqK37zHryPNhHoZ2OzCK40PU1NEsQODSng== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=DQDKTNeB; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=DQDKTNeB; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: C05F4B694 X-Spam-Score: -1.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: nsZ0yUFs3xcj On Sat, 30 Oct 2021 at 16:48, Ludovic Court=C3=A8s wrote: > zimoun skribis: > >> * guix/scripts/hash.scm (guix-hash)[package?]: New procedure. >> [hash-to-display]: Use it. >> * tests/guix-hash.scm: New test. >> --- >> guix/scripts/hash.scm | 19 +++++++++++++++++-- >> tests/guix-hash.sh | 10 ++++++++++ >> 2 files changed, 27 insertions(+), 2 deletions(-) >> >> diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm >> index f3363549d3..4f0d41629f 100644 >> --- a/guix/scripts/hash.scm >> +++ b/guix/scripts/hash.scm >> @@ -22,6 +22,9 @@ >>=20=20 >> (define-module (guix scripts hash) >> #:use-module (gcrypt hash) >> + #:use-module ((gnu packages) #:select (find-best-packages-by-name)) >> + #:use-module (guix packages) >> + #:use-module ((guix utils) #:select (package-name->name+version)) > > I think I would prefer to keep (guix scripts hash) bare-bones, not > depending on the package machinery. I understand but I do not have better to propose. :-) > Most of the time one can run: > > guix hash $(guix build -S PACKAGE) First, it is not true. For instance, $ guix hash $(guix build -S graphviz) 00skvq94xanwmprz5073mhmssz953dwf7h23p5czrpgd5s7hy444 and this hash does not correspond to the hash used by Disarchive. Because =E2=80=9Cguix build -S=E2=80=9D does not return what Gu= ix downloads but what Guix builds. The cover letter provides another example for the package =E2=80=99ceph=E2=80=99. Each time a patch or a snippet is added to origin, then it is not true. Second, it requires to download for hashing. When the hash is already in the source. I would like to avoid unnecessary downloads. I mean, it is ok to download for a couple of packages. But it becomes impractical for batch of 1200 (or more). > It=E2=80=99s not quite what you want if the package has patches or a snip= pet, > but that=E2=80=99s okay IMO. No, that=E2=80=99s not OK. :-) Because, it becomes really annoying. I hav= e to open gnu/packages, then recompose URL, then download and hash with the right format. Too many manual and boring steps when all is there. Just require CLI to be displayed. Cheers, simon PS: That=E2=80=99s what the cover letter was explaining. Sorry if it was badly worded or unclear.