From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 GItsLCsIbWOTfgAAbAwnHQ (envelope-from ) for ; Thu, 10 Nov 2022 15:18:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id IMmfKysIbWNubAAAG6o9tA (envelope-from ) for ; Thu, 10 Nov 2022 15:18:19 +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 58884163BF for ; Thu, 10 Nov 2022 15:18:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot8NY-00055C-HN; Thu, 10 Nov 2022 09:18:04 -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 1ot8NX-000551-He for guix-patches@gnu.org; Thu, 10 Nov 2022 09:18:03 -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 1ot8NX-0000M3-16 for guix-patches@gnu.org; Thu, 10 Nov 2022 09:18:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ot8NV-0005qt-K8 for guix-patches@gnu.org; Thu, 10 Nov 2022 09:18:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#58812] [PATCH 0/5] Add --symlink option to 'guix shell'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 10 Nov 2022 14:18: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: Maxim Cournoyer Cc: 58812@debbugs.gnu.org Received: via spool by 58812-submit@debbugs.gnu.org id=B58812.166808985222458 (code B ref 58812); Thu, 10 Nov 2022 14:18:01 +0000 Received: (at 58812) by debbugs.gnu.org; 10 Nov 2022 14:17:32 +0000 Received: from localhost ([127.0.0.1]:42348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ot8Mz-0005q5-Cj for submit@debbugs.gnu.org; Thu, 10 Nov 2022 09:17:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ot8Mu-0005po-8l for 58812@debbugs.gnu.org; Thu, 10 Nov 2022 09:17:28 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot8Mp-0008Ec-2o; Thu, 10 Nov 2022 09:17:19 -0500 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=kfGvwKSt2aBUcmg02GMYmSuqlXayzNOV+DB3Ebd9KLk=; b=ntvv5fjSuV4EarLEPV2p kfUg6vEVAU5cnr9YVWeA5K9ekXkeSSEOxL6FjryteOSYKId8qGvfnfamQv42NNb/CX59LEGSnZNd5 X+r0XuGM+1TbZXe2yc0ZLYhvFUu9PeNsw54vfVoGJsCa8ia1wcxT2M2xEz97ezTJh/Ph6vx9Y94pl GtZhqtQHF5JI8nKEh9A2UgJDAqkVDDh8CJZ68n3SiLc4BbzwbGnsAav5Dti2/1YPf1bGqt4wq5XBn Zo4HVnAvb2BVTGLZ8oegCAIYGtH1Sev9NXYCjMRPTw5KvdjwjCAPLxMRy3My6M/H1pIWSOu2ZVDZy ZB5mZUcb6LMjOg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot8Mo-0000GW-Mq; Thu, 10 Nov 2022 09:17:18 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20221027035100.28852-1-maxim.cournoyer@gmail.com> <20221027035100.28852-4-maxim.cournoyer@gmail.com> <87r0ybonei.fsf_-_@gnu.org> <87fsery05t.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?UTF-8?Q?D=C3=A9cadi?= 20 Brumaire an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour de la Herse 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: Thu, 10 Nov 2022 15:17:17 +0100 In-Reply-To: <87fsery05t.fsf@gmail.com> (Maxim Cournoyer's message of "Wed, 09 Nov 2022 22:10:38 -0500") Message-ID: <87sfiqhp1u.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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-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=1668089899; 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=kfGvwKSt2aBUcmg02GMYmSuqlXayzNOV+DB3Ebd9KLk=; b=RV0uu0lZqZ9B5vQ03699/5tA4wiwSS0jdxko8LFj1dOChA+DHHCa2ToHVrO4a4zNK+2lsH 19ID9CoWQ2Wn1IYvTR7XXV4/gQwatrjGPI4qGlpcgV76HRppreXz9sylihWU3pDwnwqhJ/ Bg9EX8Z59y3cVhqNtQFkZJnRi+zddr1sFO/WhBPMtm7mBmO/FnlUqYzcCaBbo5fPPWY+yo GBDrDnqLbmmOXj3qpMjecxS+GD2BifF+HLMztbTJir7HNGwDkNfE9fIQY3Ig1tV3a8Ca3B o45E3pO16qemEMy2K7lMIheZBe9IqFfR6vVhwAPM0HXfZp73jtDoGh3CqCz9uw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668089899; a=rsa-sha256; cv=none; b=I0pdFJV7jKEH7MSgC7O0+w+1mTq7yLxkhK7q+kSvaMdUY9eFIMnQzdF1703CVMICjHXrEx YrwqDlk2SAO6WREsvOrJir47Cd1655BrGj+S5BgtY0b4G/IYUKbGbuYRVR4XaamWAnqkrl AWZHlAU39THSNT4N3gVo12bbfNE8VH8oSgYI/VlQ2Fwilzoi0pz4P/04Dd7MAWTLXeC4/1 wvKjofpRF11zpphOCrfoYeqAY3TOwGon9e2dRk+6tGmt0gQCLcotixYK7dv9ThZuwCxKVi E5Btrwz93S6hv00dN9iXvhYzRqv+8AWvzQfvWoBJzqK2tG1rsYhFdY5ma2wzmw== 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=ntvv5fjS; dmarc=pass (policy=none) header.from=gnu.org; 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: -2.42 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=ntvv5fjS; dmarc=pass (policy=none) header.from=gnu.org; 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: 58884163BF X-Spam-Score: -2.42 X-Migadu-Scanner: scn1.migadu.com X-TUID: m5VDVmjJWNln 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] >>> +(define (make-symlink->directives directory) >>> + "Return a procedure that turn symlinks specs into directives that ta= rget >>> +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 becau= se this >> procedure, as shown by the comments and the use of =E2=80=98relative-fil= e-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 varian= t 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-na= me=E2=80=99 here for example is dictated by the needs of relocatable packs. It doesn=E2=80=99t = 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). >>> +++ 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-pars= er)) >> >> You can turn this into #:autoload so we don=E2=80=99t pay the price when= 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 me= an, 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. > 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.