From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oBVYBoBlw2LLcAEAbAwnHQ (envelope-from ) for ; Tue, 05 Jul 2022 00:11:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id oEVQBoBlw2JBSgAA9RJhRA (envelope-from ) for ; Tue, 05 Jul 2022 00:11:12 +0200 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 8EEF2130F2 for ; Tue, 5 Jul 2022 00:11:11 +0200 (CEST) Received: from localhost ([::1]:33686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8UHe-0003he-BZ for larch@yhetil.org; Mon, 04 Jul 2022 18:11:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8UHW-0003hK-5z for bug-guix@gnu.org; Mon, 04 Jul 2022 18:11:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54880) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8UHV-0002K9-SV for bug-guix@gnu.org; Mon, 04 Jul 2022 18:11:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o8UHV-0003M4-Mn for bug-guix@gnu.org; Mon, 04 Jul 2022 18:11:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#56114: Guix does not have a documented general and practical procedure for lowering a single lowerable object to the /gnu/store/... string. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 04 Jul 2022 22:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56114 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Maxime Devos , 56114@debbugs.gnu.org Received: via spool by 56114-submit@debbugs.gnu.org id=B56114.165697265712883 (code B ref 56114); Mon, 04 Jul 2022 22:11:01 +0000 Received: (at 56114) by debbugs.gnu.org; 4 Jul 2022 22:10:57 +0000 Received: from localhost ([127.0.0.1]:48777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8UHR-0003Li-9h for submit@debbugs.gnu.org; Mon, 04 Jul 2022 18:10:57 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:39915) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8UHM-0003LM-GB for 56114@debbugs.gnu.org; Mon, 04 Jul 2022 18:10:56 -0400 Received: by mail-wm1-f54.google.com with SMTP id c131-20020a1c3589000000b003a19b2bce36so3106097wma.4 for <56114@debbugs.gnu.org>; Mon, 04 Jul 2022 15:10:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=u5cAHAPSCdoCYQk5kLUOYAoYwSa2BYtRliInEoWZvvw=; b=l68YZRSc+gJl09FGFmPHYohLMfdupSQSw6/3iCFwi6JfT7Cg7/Y1x9+2+/lkCd+nRW lEIG5b41PuSav62g+37DRNTAorNhNaHRNGVgpdjHdyXkw4boeASEzqb7q4b8vfdbC9Og KhbvEOOdeggAQ5VrdiS/IirR4F3kL5PL3CGmu29N5ZHR9L3nGxo50AJ0O3MldvkyaA7K +ZTEI4XRzLQnug8RubdKctNJlD8QRvT6tsWzflEQtUohlzm4Ny9GxxiNJXro05nuL8G8 almJIYowOU6S47cS7MsNFRc9eDrzd7jewgp8gbwY9zoI2PW0ag3N6cdcGTR8PbaSJTz0 AcvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=u5cAHAPSCdoCYQk5kLUOYAoYwSa2BYtRliInEoWZvvw=; b=y4NEASHNvLuHKh8svWtR7lb7S+/KqL0N1piJ4sXi24BziZMrCx+5rtOq7KwdgORK0P q5udxTeyHXxNRwNwGObUjUNHapie4L3Lf94/Fkm9A2wMDP0xUKPuYzhLuiqhg8yF4HfY Y3BRvLDSD4eHAEtWSA1bGiZf38koenmMETAEaa4shqG9jP8HgAr/UsSuSi1BE42XzRHP 9RtuyMwlcTv35gUchZ/kQ6uqpyXAyrrP86kNQZLCTLuQrkRqiu7boFHdb1tzv5FIWCSt zsxSH8hBzWg94ICqMeb4aXpw/01v0ycAN5WjHaZbUORCkoEaQIjwYaKItSRib5IrPn2P jM4w== X-Gm-Message-State: AJIora+bG8IRzdbaTAyKsia8reDlY8Cb4KyZSFT55xLwcVoOSjU6qb3Y wvG1OUeySHAMTCYiaZpW4SpJjUGhPbImZg== X-Google-Smtp-Source: AGRyM1un3sp3xcZATOROcZPmh317mymWgLm2Yll7O/nJRifSCKm+GuJTxcDxhtjliLBPmWdqOGZ7tw== X-Received: by 2002:a05:600c:4e04:b0:3a1:8f34:5633 with SMTP id b4-20020a05600c4e0400b003a18f345633mr19401935wmq.169.1656972646455; Mon, 04 Jul 2022 15:10:46 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id j18-20020a05600c191200b003973ea7e725sm22282347wmq.0.2022.07.04.15.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jul 2022 15:10:45 -0700 (PDT) From: zimoun References: <1652a111d71c3e74c61904f89120ea45631c7013.camel@telenet.be> <87edz1zzrz.fsf@gnu.org> <87y1x8nasl.fsf@gmail.com> <8735fg8wlr.fsf@gnu.org> Date: Mon, 04 Jul 2022 23:59:48 +0200 In-Reply-To: <8735fg8wlr.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 04 Jul 2022 22:13:36 +0200") Message-ID: <865ykczgh7.fsf@gmail.com> 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: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1656972671; 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=u5cAHAPSCdoCYQk5kLUOYAoYwSa2BYtRliInEoWZvvw=; b=Kt5UYXmuMfqP0wnT2gUsG5Y5yYqtNc3mkFDilw/S5XRbE7PycbVOCX5run2BpWXbZnR1TI a+2kFgu9J/rTJk1Jr1O1Kj9/OOOAdTHzaD1lYedHIXmCEMr98vyfKnSrmJ2WOfthVugvLL y7LkVYC+WSvzs0DkFQaNZtSE1cNqnT3ecMQeYz8Yu1o7zqmCtWX9xnVfJoZFDN1YO141k9 HqhDRrBCWznJrW79CInFdvz1mXE8eLf0FsTctGV2zFwqEb2hl5icVBmEVvcuiMdoTw5U/p KZMK1Rc3AudQ8whB4wEDrwSxmPDn6jSZMrPryWIHGTBSWYNF5tBS+cdam9h1pg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1656972671; a=rsa-sha256; cv=none; b=TOlhlWaQTwRWJvTv9TC10PXzdy1vkp2fnVP92AnWgZVgw4s6rkLq4X4DKDrX4FNGTihsxT OT797wDm/LG+M+t5SPGYZn7o9BAvZQXxgfAh7AmY2Gv4HJ1hoL2xGHOfxjLrlBJkV/8kTk OyAp2F+9P8x0GA76KvQosj4pnUfKRebXBwCCNmL/tIFix5aGzJLvXKaR6LpLuRxBxZdmx+ y79pDp4+tqa4OXUTzJT4XhkAPQgkNkEQvUscKkOHpDp3rN0plD8lekLW7ajrs6NNvPKgWP xkoR1t74rUnxZ+65IPbOv5H1tgsfV5ImrxZtt2dT+QtaAM+uAsy7p0DeRz4LIA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=l68YZRSc; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 6.05 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=l68YZRSc; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 8EEF2130F2 X-Spam-Score: 6.05 X-Migadu-Scanner: scn1.migadu.com X-TUID: JXARK14yghHt Hi, On Mon, 04 Jul 2022 at 22:13, Ludovic Court=C3=A8s wrote: > I explicitly made =E2=80=9C,build=E2=80=9D hide that difference; I though= t one would > just want =E2=80=9C,build=E2=80=9D to do the right thing and display the = resulting store > item regardless of that kind of detail. > > Conversely, =E2=80=9C,lower=E2=80=9D is for die-hard hackers and it doesn= =E2=80=99t hide any > subtlety. Both make sense. :-) > Right, that=E2=80=99s because =E2=80=98plain-file=E2=80=99 lowers directl= y to a store item, not > to a derivation. My comment was about an unrelated thing. Well, I do not use every day G-exp nor =E2=80=99plain-file=E2=80=99 and the like. The interface appears= to me unexpected each time I use it but hey I can live with it. :-) However, the documentation (or docstring) does not appear clear, each time I have my =C2=ABaaah right!=C2=BB moment. For instance, the manual says: The local-file, plain-file, computed-file, program-file, and scheme-file procedures below return file-like objects. That is, when unquoted in a G-expression, these objects lead to a file in the store. and the docstrings say: --8<---------------cut here---------------start------------->8--- (define (plain-file name content) "Return an object representing a text file called NAME with the given CONTENT (a string) to be added to the store. This is the declarative counterpart of 'text-file'." --8<---------------cut here---------------end--------------->8--- or --8<---------------cut here---------------start------------->8--- (define* (computed-file name gexp #:key guile (local-build? #t) (options '())) "Return an object representing the store item NAME, a file or directory computed by GEXP. When LOCAL-BUILD? is #t (the default), it ensures the corresponding derivation is built locally. OPTIONS may be used to pass additional arguments to 'gexp->derivation'. This is the declarative counterpart of 'gexp->derivation'." --8<---------------cut here---------------end--------------->8--- when =E2=80=99plain-file=E2=80=99 and =E2=80=99computed-file=E2=80=99 does = not return the same type of =E2=80=9Cfile-like object=E2=80=9C. Especially when reading, --8<---------------cut here---------------start------------->8--- (define* (mixed-text-file name #:key guile #:rest text) "Return an object representing store file NAME containing TEXT. TEXT is a sequence of strings and file-like objects, as in: (mixed-text-file \"profile\" \"export PATH=3D\" coreutils \"/bin:\" grep \"/bin\") This is the declarative counterpart of 'text-file*'." --8<---------------cut here---------------end--------------->8--- it is hard to guess beforehand that =E2=80=99plain-file=E2=80=99 and =E2=80= =99mixed-text-file=E2=80=99 do not return the same type of file-like object. Therefore, I was thinking to tweak these docstrings to better underline their difference. Well, maybe it is only me. :-) Cheers, simon PS: It remembers me unrelated [1] mentioning confusion about =E2=80=9Cfile or file-like object=E2=80=9D. :-) 1: