unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: zimoun <zimon.toutoune@gmail.com>
Cc: 51307@debbugs.gnu.org
Subject: [bug#51307] Content hashes and file tree serialization methods
Date: Sun, 31 Oct 2021 15:48:16 +0100	[thread overview]
Message-ID: <87mtmpntcf.fsf_-_@gnu.org> (raw)
In-Reply-To: <86tugyleub.fsf@gmail.com> (zimoun's message of "Sat, 30 Oct 2021 17:19:56 +0200")

zimoun <zimon.toutoune@gmail.com> skribis:

>> That’s expected: ‘--recursive’ uses a different computation method,
>> including file metadata (technically, it serializes the file as a nar
>> and computes the hash of the nar).
>
> Yes, but that’s odd.  It should be the same computation method for
> tarballs.  Nothing is recursive for a tarball

Thinking more about it, I think confusion stems from the term
“recursive” (inherited from Nix) because, as you write, it doesn’t
necessarily have to do with recursion and directory traversal.

Instead, it has to do with the serialization method.

Thus, probably, ‘--recursive’ could be replaced by a ‘-S’ flag:

  guix hash -S nar something

or:

  guix hash -S none something
  guix hash -S git something
  guix hash -S swh something

‘-S none’ would be like not passing ‘-r’; ‘-S git’ would serialize the
file/directory as a Git tree; ‘-S swh’ would serialize it the SWH way,
which is like Git except it preserves empty directories (Disarchive
implements the Git/SWH methods already.)

Thoughts?

As mentioned towards the end of
<https://guix.gnu.org/en/blog/2019/connecting-reproducible-deployment-to-a-long-term-source-code-archive/>,
being able to deal with different tree serialization methods would be
useful going forward; for instance, if we had the option to store
SWH-style content hashes for origins, that’d help a lot.  Allowing ‘guix
hash’ to deal with that is a first step in that direction.

(Apologies for slipping a bit off-topic…)

Ludo’.




  parent reply	other threads:[~2021-10-31 14:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 16:50 [bug#51307] [PATCH 0/2] guix hash: eases conversion zimoun
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     ` Ludovic Courtès [this message]
2021-11-18  0:29       ` [bug#51307] Content hashes and file tree serialization methods 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=87mtmpntcf.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=51307@debbugs.gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /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).