From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uHhQAckPbWPbJgEAbAwnHQ (envelope-from ) for ; Thu, 10 Nov 2022 15:50:49 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wEZmAckPbWM2IQAAauVa8A (envelope-from ) for ; Thu, 10 Nov 2022 15:50:49 +0100 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 AF4BA3C2D2 for ; Thu, 10 Nov 2022 15:50:48 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot8sr-0007a4-OP; Thu, 10 Nov 2022 09:50:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot8sY-0007XH-Lx for guix-patches@gnu.org; Thu, 10 Nov 2022 09:50:10 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot8sU-0001TY-IU for guix-patches@gnu.org; Thu, 10 Nov 2022 09:50:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ot8sT-0006fa-Vc for guix-patches@gnu.org; Thu, 10 Nov 2022 09:50:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#58812] [PATCH 0/5] Add --symlink option to 'guix shell'. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 10 Nov 2022 14:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58812 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 58812@debbugs.gnu.org Received: via spool by 58812-submit@debbugs.gnu.org id=B58812.166809178425597 (code B ref 58812); Thu, 10 Nov 2022 14:50:01 +0000 Received: (at 58812) by debbugs.gnu.org; 10 Nov 2022 14:49:44 +0000 Received: from localhost ([127.0.0.1]:42382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ot8sB-0006ek-F6 for submit@debbugs.gnu.org; Thu, 10 Nov 2022 09:49:43 -0500 Received: from mail-qk1-f181.google.com ([209.85.222.181]:35411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ot8s9-0006eW-LW for 58812@debbugs.gnu.org; Thu, 10 Nov 2022 09:49:42 -0500 Received: by mail-qk1-f181.google.com with SMTP id p18so1200607qkg.2 for <58812@debbugs.gnu.org>; Thu, 10 Nov 2022 06:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=h676HXPoHraPq3wL/psFnkd+VkgM/jfnbm5Tuqbo9kI=; b=VyC5rSvaZeIOCnQc8tldFAd0z3n1RZy3sEAn/JiwHmfXMrJfWX32o/7De1sxvMwZG/ VLLdKPKvlj4gUbeegFELVEzV4HvfnCNwqnQYjTIT2FBIzYnR3KlMuujQBkk2dk1vFUhZ JjaZBk0iN4eb/55elyYZ4hqJtpDfxPaLHsu/dFZx/miwb6cDnWIK4PUeheSm4q8SVKPw r/FneyTTvpckqVvzgdrRP7DXi7YZQWhO2lqFeqodDAzLKPmiV92hMYMTUI+RYofNJ+c3 AhlAn1mDdzn/sQdicSg6n5It/H5cT4cj+BGpDmCEyzKXweFvUOMIqeV1/KFapyBVbkzL Wc6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=h676HXPoHraPq3wL/psFnkd+VkgM/jfnbm5Tuqbo9kI=; b=SMcqeJajMezDMpQe0j3w7Fi/XLB1wuf6IYolNNFOP3xusHJT7K/wyahGg0bfIKY67D 7gd5Tw5duTYiHhH6o1LCyVFTcTG6uA5NyfTScyj9xGgmBOd2gi4B3ZQWCgcXqsMCcEqM bUsjN2HHlPqF/XJBmYDiKuX/BHivSGtYXPrPq00+L4vei7iCgjMd/IkgbAtSfpjwU8r1 wzFLzM32cx4Vhc1vgdrpsmpIgsitN/93eVjsY/Bnpsjq1vu0I3E4dFEcca263rslpUF0 OtD4Oiu+bZDbr0xQ4UtYFKvfRMEwmq/X1F9OzzmuN+XFnUU2IrmRr3G3qrOryIE5DjRo 9KtA== X-Gm-Message-State: ACrzQf0c23RSZu0uis8MnXDVUc2YkVcoYTUjEE51OSbLGdHyzdyiUjZ9 nGpI19pwA2f1WhT+xO9cpJmZ3EJceoI= X-Google-Smtp-Source: AMsMyM7k4HSZ0puO7Z7r56VydYhAfaFMr6zUuGZW369SGIwq47LKsr9MGn9XjQBQ5CkaWSC8cDY5BQ== X-Received: by 2002:a05:620a:c4a:b0:6cf:8135:e81d with SMTP id u10-20020a05620a0c4a00b006cf8135e81dmr46039066qki.280.1668091775686; Thu, 10 Nov 2022 06:49:35 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id y22-20020a05620a44d600b006f9c2be0b4bsm13302680qkp.135.2022.11.10.06.49.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 06:49:35 -0800 (PST) From: Maxim Cournoyer References: <20221027035100.28852-1-maxim.cournoyer@gmail.com> <20221027035100.28852-4-maxim.cournoyer@gmail.com> <87r0ybonei.fsf_-_@gnu.org> <87fsery05t.fsf@gmail.com> <87sfiqhp1u.fsf@gnu.org> Date: Thu, 10 Nov 2022 09:49:34 -0500 In-Reply-To: <87sfiqhp1u.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 10 Nov 2022 15:17:17 +0100") Message-ID: <87k042x3sx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1668091848; 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=h676HXPoHraPq3wL/psFnkd+VkgM/jfnbm5Tuqbo9kI=; b=BnCXJrNoXEGOfBgpk4XEX9muPOmX82DChXTmYjYHEPWLC/ig4QvHpS7Fl9Jo6oMMLcfNUP Tt9IAdHHGxM+wwELXmAjTVbmId+Z20phBjY7bna2Y+zFWgHvNL7eCwqE8WEFCHr6x60foe UhkYXm0v5tbR8NhNBKn0ot29EgUmtLtFIuRIrGgKQqPL0aydnx0BrrK5jHZQDSQmKg9v4r kTS3eYXkoPGCQl9/wk5w7K1pnfO6aNJ/6WhzEAX9gs9eaMp2a+Aek8fKfMnEeUqis/uB3v VVNUWOSzLNWMaq5qpTBQg8o7jQ4seQYPVVkV7HqArrpDjL0H4qbhGLWsVeGpbg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668091848; a=rsa-sha256; cv=none; b=QrTGGn3J/McXiK3peqRT75nFMIKxpATRaHqxKIoMAaC1ME8eWqBfnsfpxE0AqYPtHbg8ob Z9h4cFNpmkDIi9KsHiTiW6e4+C+gf4XEUjOvR4PpqXRzLt5N7el5rC6QFWY8JlB6OZW+Ks DloqF0HSUFp3pcbwSfUe6zb5xGpdmdGZrFEkdrK2Y8Lwrk2q60CmGF3WrF8U1+e7YRyKqA HvwFyPmwHD77Ws6baw6H9kcrVK39rwokherJWkZ/yOpEgMbHwJdTgD6X9nLeG24NdmjVSa xCIgrekfHKW54hkmHq5fJ2FS+OJzz5u2IH0KamdwcpvGUjOcORmqG5O6tSefcA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=VyC5rSva; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.48 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=VyC5rSva; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AF4BA3C2D2 X-Spam-Score: 7.48 X-Migadu-Scanner: scn1.migadu.com X-TUID: cNMMBet8fwuB Hi Ludo! Ludovic Court=C3=A8s writes: > Hi Maxim! > > Maxim Cournoyer skribis: > >>> We should refrain from using @ref in sentences (info "(texinfo) @ref"). >>> Instead, I=E2=80=99d write: >>> >>> documented for @command{guix pack} (@pxref{pack-symlink-option}). >> >> I've heard that from you before, but is there a reason against? I like >> to know the rationale for doing things a certain way, lest I forget :-). >> From info '(texinfo) @ref': > > It=E2=80=99s right below the bit you quoted: > > The '@ref' command can tempt writers to express themselves in a > manner that is suitable for a printed manual but looks awkward in the > Info format. Bear in mind that your audience could be using both the > printed and the Info format. For example: [=E2=80=A6] Yes, and I don't get it :-) --8<---------------cut here---------------start------------->8--- The '@ref' command can tempt writers to express themselves in a manner that is suitable for a printed manual but looks awkward in the Info format. Bear in mind that your audience could be using both the printed and the Info format. For example: Sea surges are described in @ref{Hurricanes}. looks ok in the printed output: Sea surges are described in Section 6.7 [Hurricanes], page 72. but is awkward to read in Info, "note" being a verb: Sea surges are described in *note Hurricanes::. --8<---------------cut here---------------end--------------->8--- I don't see a "note" in the final sentence that should make it awkward? It's lacking a "see " prefix though, which could help to make things a bit clearer, I guess. It looks the same in info as in the pxref example given above: --8<---------------cut here---------------start------------->8--- For example, For more information, @pxref{This}, and @ref{That}. produces in Info: For more information, *note This::, and *note That::. --8<---------------cut here---------------end--------------->8--- I'm also unsure where the "see" comes before That:: above. Is it a mistake in the manual? >>>> +(define (make-symlink->directives directory) >>>> + "Return a procedure that turn symlinks specs into directives that t= arget >>>> +DIRECTORY." >>>> + (match-lambda >>>> + ((source '-> target) >>>> + (let ((target (string-append directory "/" target)) >>>> + (parent (dirname source))) >>>> + ;; Never add a 'directory' directive for "/" so as to preserve= its >>>> + ;; ownership and avoid adding the same entries multiple times. >>>> + `(,@(if (string=3D? parent "/") >>>> + '() >>>> + `((directory ,parent))) >>>> + ;; Note: a relative file name is used for compatibility with >>>> + ;; relocatable packs. >>>> + (,source -> ,(relative-file-name parent target))))))) >>> >>> I think it=E2=80=99s a case where I would refrain from factorizing beca= use this >>> procedure, as shown by the comments and the use of =E2=80=98relative-fi= le-name=E2=80=99, >>> is specifically tailored for the needs to =E2=80=98guix pack -f tarball= =E2=80=99. >>> >>> I=E2=80=99d prefer to have a similar but independently maintained varia= nt of >>> this procedure in (guix scripts environment) to avoid difficulties down >>> the road. >> >> I considered to duplicate it, but I opted to reuse it in the end because >> I care that the behavior is exactly the same between the two actions >> (guix shell --symlink vs guix pack --symlink). If the way we handle >> this is to be changed in the future, I'd want both to be changed at >> once, so they remain consistent. Does this make sense? > > They don=E2=80=99t have to be consistent. Use of =E2=80=98relative-file-= name=E2=80=99 here for > example is dictated by the needs of relocatable packs. It doesn=E2=80=99= t have > to be this way here. > > I think it=E2=80=99s best to keep separate copies here (they likely won= =E2=80=99t be > exactly the same). OK, I see you point about relative-file-name not being needed. I'll make the change. >>>> +++ b/guix/scripts/environment.scm >>>> @@ -33,8 +33,10 @@ (define-module (guix scripts environment) >>>> #:use-module ((guix gexp) #:select (lower-object)) >>>> #:use-module (guix scripts) >>>> #:use-module (guix scripts build) >>>> + #:use-module ((guix scripts pack) #:select (symlink-spec-option-par= ser)) >>> >>> You can turn this into #:autoload so we don=E2=80=99t pay the price whe= n not >>> using =E2=80=98--symlink=E2=80=99. >> >> Done! Could Guile simply always use lazy loading (autoload by default)? > > #:select could be synonymous with #:autoload, if that=E2=80=99s what you = mean, > but in general Guile cannot know whether autoloading is semantically > equivalent to eagerly loading: there might be side-effects happening > when the top-level of the module runs. Perhaps there could be a strict execution mode where it is assumed that side effects are not used when modules run? That seems a seldom used feature anyway, and could enable making lazy loading of modules the default. >> Otherwise, when is it OK to use autoload and when is it not? > > #:autoload exists as a way to amortize initialization costs and make > sure only necessary functionality gets loaded, thereby reducing CPU and > memory usage. > > Only the module user can tell whether #:autoload is appropriate. In > general you=E2=80=99d use it for optional functionality that has a > non-negligible memory footprint or that would noticeably degrade startup > time. > > Ludo=E2=80=99. Thank you for the explanations and review! I'll send a v3 shortly. -- Maxim