unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: 51307@debbugs.gnu.org
Cc: zimoun <zimon.toutoune@gmail.com>
Subject: [bug#51307] [PATCH 0/2] guix hash: eases conversion
Date: Wed, 20 Oct 2021 18:50:20 +0200	[thread overview]
Message-ID: <20211020165020.3358311-1-zimon.toutoune@gmail.com> (raw)

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	other threads:[~2021-10-20 16:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 16:50 zimoun [this message]
2021-10-20 16:54 ` [bug#51307] [PATCH 1/2] scripts: hash: Improve error handling zimoun
2021-10-20 16:54   ` [bug#51307] [PATCH 2/2] scripts: hash: Support file or package zimoun
2021-10-30 14:48     ` [bug#51307] [PATCH 0/2] guix hash: eases conversion Ludovic Courtès
2021-10-30 15:34       ` zimoun
2021-10-30 14:46   ` Ludovic Courtès
2021-10-30 15:40     ` zimoun
2021-10-31 13:43       ` Ludovic Courtès
2021-10-30 14:53 ` Ludovic Courtès
2021-10-30 15:19   ` zimoun
2021-10-30 15:24     ` zimoun
2021-10-31 14:03     ` Ludovic Courtès
2021-11-09  9:18       ` zimoun
2021-10-31 14:48     ` [bug#51307] Content hashes and file tree serialization methods Ludovic Courtès
2021-11-18  0:29       ` zimoun
2021-11-18  0:20 ` [bug#51307] [PATCH v2 0/3] scripts: hash: Several files and serializer zimoun
2021-11-18  0:20   ` [bug#51307] [PATCH v2 1/3] scripts: hash: Support several files zimoun
2021-12-17 16:17     ` Ludovic Courtès
2021-11-18  0:20   ` [bug#51307] [PATCH v2 2/3] scripts: hash: Add 'serializer' option zimoun
2021-12-17 16:17     ` Ludovic Courtès
2021-11-18  0:20   ` [bug#51307] [PATCH v2 3/3] scripts: hash: Add git serializer zimoun
     [not found]     ` <87bl1bjsxf.fsf@gnu.org>
     [not found]       ` <CAJ3okZ00+BSw=nuhGP8NTwU8ZmitzrfFzTw0WecsOB9rZ+hG_g@mail.gmail.com>
2021-12-21  9:09         ` Ludovic Courtès
2021-12-15  8:06   ` [bug#51307] [PATCH v2 0/3] scripts: hash: Several files and serializer zimoun
2021-12-15 10:05     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211020165020.3358311-1-zimon.toutoune@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=51307@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).