GNU bug report logs - #51307
[PATCH 0/2] guix hash: eases conversion

Previous Next

Package: guix-patches;

Reported by: zimoun <zimon.toutoune <at> gmail.com>

Date: Wed, 20 Oct 2021 16:51:01 UTC

Severity: normal

Tags: patch

Done: zimoun <zimon.toutoune <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 51307 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 51307 <at> debbugs.gnu.org
Subject: Re: bug#51307: [PATCH 0/2] guix hash: eases conversion
Date: Sat, 30 Oct 2021 17:34:55 +0200
On Sat, 30 Oct 2021 at 16:48, Ludovic Courtès <ludo <at> gnu.org> wrote:
> zimoun <zimon.toutoune <at> gmail.com> 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 @@
>>  
>>  (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 “guix build -S” does not return what Guix downloads
but what Guix builds.  The cover letter provides another example for the
package ’ceph’.

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’s not quite what you want if the package has patches or a snippet,
> but that’s okay IMO.

No, that’s not OK. :-)  Because, it becomes really annoying.  I have 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’s what the cover letter was explaining.  Sorry if it was badly
worded or unclear.




This bug report was last modified 3 years and 155 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.