guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#51307] [PATCH 0/2] guix hash: eases conversion


From: zimoun
Subject: [bug#51307] [PATCH 0/2] guix hash: eases conversion
Date: Wed, 20 Oct 2021 18:50:20 +0200

Hi,

The first patch is a tiny improvement on the error handling.

 1. The current situation does not correctly handle error because of
    ’with-error-handling’.
 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-point.
    That’s what the first patch correct.

Moreover, it is possible to pass several arguments,

--8<---------------cut here---------------start------------->8---
$ find . -maxdepth 1 -type d | xargs guix hash -r
guix hash: erreur : nombre d'arguments incorrect

$ find . -maxdepth 1 -type d | xargs ./pre-inst-env guix hash -r
1rzh9b4b4qc5nf4mq601jr2p3xsw690q6d4137ymgq0an9xsli9v
1cgdvnjlh1ziwb12ax2wcrs7ddr44c2nhjali1v3ilsv7fsm79fq
0x64hc3jqq1jwbym5gvcbnsck4v08xxa3kr44m9961nsml1rpmld
03gzaccd1cws05sf469l9ghf9mhxqsnlkkbr859l13alba5isirb
1qmmppfg65wdzcg137hg62ic31ykzvgb26brcv77is1nszvrqm14
1ajw5s2ykyyvpaisv8xbd8rn77q1whk2fxmyfqn3qyzxjf8vw7sz
1fjnk5hsfvsyahf997f6nca5c01jh7gm590xcx2d2adjj2vm51r2
0hm8s9hc6c4x32v3ff0kz7npd1n2i3ld6p69ya68wxfhhkhwpg6r
1k1y2hax62r2jj7j8vk8wx6mhww42g77x1fp7iy151alplv6mi23
1c3dg3mfl4kg0px7rdj52qyxkpn00sdaf7z1bxib4n2wy175gd9m
15680dqbzr7dcngyqblyzqnr5s74rka4qh76n2pdfndd9gc81j0h
0hvlnas7grx69hrxbxz3zw9z80wr02m2c0lbjs0kcxv6wv3da871
1zvw0k4gl3sj3hagp415iy0dcqx8c1k3zwph3n1xcg0z2ljfqpl2
--8<---------------cut here---------------end--------------->8---



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 upstream:

  $ ./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).

For instance, now it is really cheap to do:

--8<---------------cut here---------------start------------->8---
guix package -A | cut -f1 | grep julia | xargs ./pre-inst-env guix hash -f 
base16
--8<---------------cut here---------------end--------------->8---


All the best,
simon



zimoun (2):
  scripts: hash: Improve error handling.
  scripts: hash: Support file or package.

 guix/scripts/hash.scm | 75 ++++++++++++++++++++++++++++++-------------
 tests/guix-hash.sh    | 10 ++++++
 2 files changed, 63 insertions(+), 22 deletions(-)


base-commit: 19d3cfec72720a4a1339be3d14f4d88ae5bd59f4
--
2.32.0





reply via email to

[Prev in Thread] Current Thread [Next in Thread]