From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QO4OLPOsfmHCrAAAgWs5BA (envelope-from ) for ; Sun, 31 Oct 2021 15:49:23 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cCifJ/OsfmF8bAAAbx9fmQ (envelope-from ) for ; Sun, 31 Oct 2021 14:49:23 +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 38930BFDE for ; Sun, 31 Oct 2021 15:49:23 +0100 (CET) Received: from localhost ([::1]:46928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhC9C-00010M-Cm for larch@yhetil.org; Sun, 31 Oct 2021 10:49:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhC8s-0000yn-KU for guix-patches@gnu.org; Sun, 31 Oct 2021 10:49:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhC8s-0007XK-6h for guix-patches@gnu.org; Sun, 31 Oct 2021 10:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mhC8s-0006yy-40 for guix-patches@gnu.org; Sun, 31 Oct 2021 10:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51307] Content hashes and file tree serialization methods Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 31 Oct 2021 14:49: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: zimoun Cc: 51307@debbugs.gnu.org Received: via spool by 51307-submit@debbugs.gnu.org id=B51307.163569170826797 (code B ref 51307); Sun, 31 Oct 2021 14:49:02 +0000 Received: (at 51307) by debbugs.gnu.org; 31 Oct 2021 14:48:28 +0000 Received: from localhost ([127.0.0.1]:32790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhC8J-0006y9-Nx for submit@debbugs.gnu.org; Sun, 31 Oct 2021 10:48:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhC8I-0006xx-Fi for 51307@debbugs.gnu.org; Sun, 31 Oct 2021 10:48:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhC8B-0007PE-Tr; Sun, 31 Oct 2021 10:48:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=4IZKmrg09zASWnpd7e1QkH5WR6+7JWL6lHQB2cgl9cU=; b=nTiuMtkWlvp79F99jNXk hpM+vjov0OTJ6QYi4aaapGM8/AUUgcnlIci7O6GMrhsRLbJeTt0nDpTIWjF8E4DkM3AkkX2w3GiBZ IDJAx+NZdInd0q5zbmk9RBX3sknVXXPsiA21vSbqqFpPuM0sB8c9DIMtm8u2isUvMcZ03zXjwJkry EwpfoxD3mEz7QSmJ8AS8ZakM6jVBOyT98fVMk2URxbAJRjICrduMQG1PMNDVxMC7EJEtHyMBjAPCT 2ynTFAqpeP+gxcI42r6fbUDwSbBeG5oRVnRuf+HtYh4b9hCVwoBkwgSpJNBcXvLMB/v41hrqlTyTk dLdr3tYGcdJP9w==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55430 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhC8B-0008RS-I7; Sun, 31 Oct 2021 10:48:19 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211020165020.3358311-1-zimon.toutoune@gmail.com> <87wnlusgwy.fsf@gnu.org> <86tugyleub.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 10 Brumaire an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 31 Oct 2021 15:48:16 +0100 In-Reply-To: <86tugyleub.fsf@gmail.com> (zimoun's message of "Sat, 30 Oct 2021 17:19:56 +0200") Message-ID: <87mtmpntcf.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) 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=1635691763; 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=4IZKmrg09zASWnpd7e1QkH5WR6+7JWL6lHQB2cgl9cU=; b=qQ+ND7GDlAV5y1l/5MXPZsoXZImc8vNQVKt29VDy5O3sl/iWeH2OWFvh+apfKMwrJB7suO FxBxmfzH0UdZAhrcauZg7I6L6ALtY+UtiR91SAk9evl3AXd7tBCPkUz2DvFC4pOIxbjGWM DiIuzhglTa5pWXYIf2oZZ1IaSmM22M9ABK++1ZOtQdLeSlLu6nDyRjyvfFTYahTcB9VfRG FNa39qyuDF3ezk/g2CEX0DeJo8QrTZGsMCgIb+Rx1sqvgewdpX6leoaU2INzpaP8nI+0i9 A9gA4wKXYDWZA6ehdtlFdS2wAyu+GKob7wjGdwry5NHLqtz2JQg8GJL853VPyA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635691763; a=rsa-sha256; cv=none; b=l6qS0XFF2ucZ2g1VcBSUj/Cjk+nH3dGWuidRU4+xd5LZCEK3LAcj9Hf9xnQorR+8mY4r6A NtLmniYjw4p+6paMU7sPrBCEsH73DSreG38CkRToBpK6KZaz6Gdaiwn1SaBRgaISF62rwI WgxAJwKQKCgzCZurX8cjqrvypAtBgpDQZLYQEq+Sr82/N0igDUQL/MI2m3xC1c0OZ8C4kW CtqAOenSxCS1OeigdaafIt6dMQEm2a4dgSBvA8ZRFJ42A9+AyNcR9CUJlCr5fjDOG0Z5Nx 4R+Deatm+g3Swm1bhhPdT3XY40QAYAcUvwWjKktNWuCU7rvGG05Sa0FSCgpYVA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nTiuMtkW; dmarc=pass (policy=none) header.from=gnu.org; 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.42 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nTiuMtkW; dmarc=pass (policy=none) header.from=gnu.org; 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: 38930BFDE X-Spam-Score: -1.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: DQTv6VIFjcHl zimoun skribis: >> That=E2=80=99s expected: =E2=80=98--recursive=E2=80=99 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=E2=80=99s 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 =E2=80=9Crecursive=E2=80=9D (inherited from Nix) because, as you write, it = doesn=E2=80=99t necessarily have to do with recursion and directory traversal. Instead, it has to do with the serialization method. Thus, probably, =E2=80=98--recursive=E2=80=99 could be replaced by a =E2=80= =98-S=E2=80=99 flag: guix hash -S nar something or: guix hash -S none something guix hash -S git something guix hash -S swh something =E2=80=98-S none=E2=80=99 would be like not passing =E2=80=98-r=E2=80=99; = =E2=80=98-S git=E2=80=99 would serialize the file/directory as a Git tree; =E2=80=98-S swh=E2=80=99 would serialize it t= he 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 , 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=E2=80=99d help a lot. Allowing = =E2=80=98guix hash=E2=80=99 to deal with that is a first step in that direction. (Apologies for slipping a bit off-topic=E2=80=A6) Ludo=E2=80=99.