From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SGyiNSU9imGBPAAAgWs5BA (envelope-from ) for ; Tue, 09 Nov 2021 10:19:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qMZVMSU9imGDGwAA1q6Kng (envelope-from ) for ; Tue, 09 Nov 2021 09:19:33 +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 0BC9530266 for ; Tue, 9 Nov 2021 10:19:33 +0100 (CET) Received: from localhost ([::1]:45332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mkNHu-0003WU-TX for larch@yhetil.org; Tue, 09 Nov 2021 04:19:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkNHS-0002Wu-RX for guix-patches@gnu.org; Tue, 09 Nov 2021 04:19:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49287) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mkNHS-0006Ib-IX for guix-patches@gnu.org; Tue, 09 Nov 2021 04:19:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mkNHS-0007UJ-F5 for guix-patches@gnu.org; Tue, 09 Nov 2021 04:19:02 -0500 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: Tue, 09 Nov 2021 09:19: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.163644950028723 (code B ref 51307); Tue, 09 Nov 2021 09:19:02 +0000 Received: (at 51307) by debbugs.gnu.org; 9 Nov 2021 09:18:20 +0000 Received: from localhost ([127.0.0.1]:60833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkNGm-0007TD-7N for submit@debbugs.gnu.org; Tue, 09 Nov 2021 04:18:20 -0500 Received: from mail-wm1-f52.google.com ([209.85.128.52]:38814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkNGi-0007Sw-P6 for 51307@debbugs.gnu.org; Tue, 09 Nov 2021 04:18:18 -0500 Received: by mail-wm1-f52.google.com with SMTP id a20-20020a1c7f14000000b003231d13ee3cso1323401wmd.3 for <51307@debbugs.gnu.org>; Tue, 09 Nov 2021 01:18:16 -0800 (PST) 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=ShxtBv0JImSrVdr2rWQwCW/nvjXlY9/Brb9828RxXAM=; b=Ha6MUJsMRsdwRuN4DDmmCGenQzcrWtC4WKc7MHvcFLeEc1ZalPju39GkWbeZS3EErQ 1GaqJ2MpwRHM1/kynVVxZgOesjAljbrXLEzrey1I0FvcEvPMeql0v1aVT+RGjR2dAOtF QKSjxuEaROlFgnkg3oUr7mGv9lWYDXoG4QasEnHNq9JluomhnPjPFJYkhB5Q3gGaShuJ 6NpbEQMgI6MQ08DZfxkOo2jjSLds4+vB5w910lW6aTcBkHYBCXWYk9cNaHtqRyw/XYhr AP4T3MbOqFMloQPG/g+mSZcM7zTs9jOv1Glwoo0rJ0eobXtvH/evBJGMAhWAaEBzWKW8 8Okw== 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=ShxtBv0JImSrVdr2rWQwCW/nvjXlY9/Brb9828RxXAM=; b=eGW3+4UJe7CkHGWoInGF64bO4xtt0vBeIOaKfGYhw6ci+k9mtBTOHSLFuSxjieYBfF LB/by0JH5z8iQqrrvctvQlC7KjR7JYh83dzd06IWLP/bUoUw0A+M48vFwK5/E5QPlhPf 60bWutgppnlBke0Tc3iRolg63iJCVpBi3Utm1DC2E1a85X0tJP4eFowJ3P1PdWTfaIgD vTVgwckis1n/+dmXPuTdQmMTe03WWA11oSfuAtiKg6SPnV4ngv//H8SSFpRW1auOQrVL 0y9QfxfDM6fd0GClwvYgwlCes9Hw9t5URk7XuMqk6YAeWOAB8Xp+syTwBfG7L7McoZed ffhw== X-Gm-Message-State: AOAM530d2brYyjphqIhdC0KUUFbhjinP+WzVL+9ghR38WPy/9c9u79X9 bvBkBOXmltc/o1i61QWnGhJNFVSnQEI= X-Google-Smtp-Source: ABdhPJwmvzffBrhyLoUFlOJNNh1W0Et4uTRRlsWh8GrHeeWvRxvk/dDFPpNoF6pPrDAJDj91aDXjiw== X-Received: by 2002:a05:600c:198f:: with SMTP id t15mr5574804wmq.94.1636449490780; Tue, 09 Nov 2021 01:18:10 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id m14sm13705078wrp.28.2021.11.09.01.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 01:18:10 -0800 (PST) From: zimoun In-Reply-To: <87mtmppa0a.fsf@gnu.org> References: <20211020165020.3358311-1-zimon.toutoune@gmail.com> <87wnlusgwy.fsf@gnu.org> <86tugyleub.fsf@gmail.com> <87mtmppa0a.fsf@gnu.org> Date: Tue, 09 Nov 2021 10:18:01 +0100 Message-ID: <86zgqdbsc6.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=1636449573; 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=ShxtBv0JImSrVdr2rWQwCW/nvjXlY9/Brb9828RxXAM=; b=gaSpVhZ5c67m60y2DyDU/5EEwfbibRzP+c1dduOyuT17BKo3QHCJFpYvbBkMWnUr2w4/ZG dPDD1d0fY6N2hoMn1KLxl5EKBsDp4EusNJGHsg0NZU6CAxBKPdxPyrtPGsTfSSI+6S0pbS mMqOqVDPKM5GGQ7o+F5GidPkQOdZotuxr05llN/4dAl5BmLz7oGzDwXzwPH0ScCW3nx6oS zPydTH712XG5ldnHYBoNgj47pJJ/ur8//LdyubZ48Ihzo2kqjs19i1Sr00bIE7TbpzIPzo z/IbeGKlq8EEd/LjTcI8Gf+DL2oJ9BERZdSl3OiLl82Up6LyG+LXIFa0KWpa7A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636449573; a=rsa-sha256; cv=none; b=djoIj32KKm1OmpXWZk0oARtXFJEFTNlfI4XMZog7xi8KFR3qr63DFPNc6E+QfPmOmgpQgT ct4hB91UFvvc+Uemkyjq1l/FH4zlpL5M+pzntltjOMUgJw2LnCYdGuotkMvzz/bvAHwFJG ATqG/x97L7iQCFL83UHJumN6pHfYuKM5KIMtWr1OZBCzhGAQaFNbRaxt9OJz/NSU33IKR6 itq1Kud+gTbF1nCmD3fqYMyPheQLgtDZuCIOrBM5JoPKLYjWpZjgJFLBAxC7lkzRuHSX0b ygCSo6yzqVGcKYBfKujmg4YtRvGJ3u/zRvwKSeCQrnBLybU63fffYbwqWg4Rng== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Ha6MUJsM; 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=Ha6MUJsM; 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: 0BC9530266 X-Spam-Score: -1.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: I5Z7yFCkh1Ty Hi Ludo, On Sun, 31 Oct 2021 at 15:03, Ludovic Court=C3=A8s wrote: [...] >> The patch is printing the hash of upstream and it is the only hash which >> matters =E2=80=93 speaking both about packaging and about Disarchive. >> Therefore, there is no ambiguity here. > > Sorry, I think I wasn=E2=80=99t clear. Consider this: > > touch ceph > guix hash ceph > > What does it print? It would print the first clause. Two things: 1. How many times do you run =E2=80=9Cguix hash foo=E2=80=9D inside a folder where there is a folder= or file =E2=80=99foo=E2=80=99? and 2. It is easy to document this corner case and = =E2=80=9Cguix hash ./ceph=E2=80=9D fixes the issue. Well, the root is that I disagree with your comment, I guess. :-) The way I see it, =E2=80=98guix hash=E2=80=99 is a low-level tool a= nd it should do what I ask for and not try to second-guess. Bah it is similar as Garbage Collector debate; Pythonista says: devs are too dumb for managing memory by themselves, it has to be done automatically; C devs says: managing memory is too important for second-guessing dev intent. ;-) Note that from my understanding, =E2=80=9Cguix hash=E2=80=9D and =E2=80=9Cg= uix download=E2=80=9D are somehow redundant, i.e., =E2=80=9Cguix download=E2=80=9D should be included= to =E2=80=9Cguix hash=E2=80=9D. Another story=E2=80=A6 but I was not drifting yet. ;-) > If the result depends on external context (the presence or not of a > =E2=80=98ceph=E2=80=99 file in $PWD), that=E2=80=99s a brittle interface = IMO. I trust your experience on designing interfaces. :-) > This could be addressed by requiring users to be explicit, along these > lines: > > guix hash ceph # compute the hash of the file called =E2=80=98ceph= =E2=80=99 > guix hash -P ceph # print the hash of the =E2=80=98ceph=E2=80=99 package Well, let=E2=80=99s go for that. One last question about bikeshedding, what should do guix hash -P ceph ceph =20=20=20 ? Print twice hash of ceph package? Or print hash of ceph package and hash of ceph file? > But there=E2=80=99s another issue with the interface: =E2=80=98guix hash = -P ceph=E2=80=99 would > merely print the hash as it appears in the package definition. Thus > =E2=80=98-H=E2=80=99 and =E2=80=98-r=E2=80=99 would have no effect, which= can be confusing. Wow, many many options of many many Guix commands cannot be composed. Aside, these two still open bugs, for instance, guix package --list-installed --show=3Dhello guix package --show=3Dhello --list-installed guix package --list-available --list-installed guix package --list-installed --list-available And many more, guix pull --commit=3D1234 --branch=3Dcore-updates and so =E2=80=9Cguix time-machine=E2=80=9D too. And I am not speaking abou= t build transformations. Bah, ok let=E2=80=99s avoid to add another one. :-) It seems possible to d= etect and display a warning that -H or -r does not take effect because -P. > Yes, maybe? I don=E2=80=99t know. I think it=E2=80=99s important to tak= e a step back: > perhaps we=E2=80=99re in need of a better tool around SWH and Disarchive,= rather > than just a tool that displays a hash. We already have all the APIs to > do these things anyway, so if we clarify the use case, we can surely > glue things together to build a tool that will be more convenient. > (Maybe you=E2=80=99ve already written scripts to help you?) I will start to collect my needs and what I am doing when playing with that. And I will try to put that inside an extension, such as =E2=80=9Cguix archival=E2=80=9D. It will be a basis for judging if it is worth or not. No, I do not have scripts. I mean, each time I work on that topic, I write again and again some quick and dirty stuff coupled to ugly Bash glue code. This patch is because I have been annoyed to repeat again and again. :-) Well, I am going to send another version adding multi FILE, first patch which is making consensus, and second patch the option --package/-P. Cheers, simon