From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 09 09:35:05 2021 Received: (at 50967) by debbugs.gnu.org; 9 Oct 2021 13:35:05 +0000 Received: from localhost ([127.0.0.1]:52498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZCVE-0005Ys-Kg for submit@debbugs.gnu.org; Sat, 09 Oct 2021 09:35:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60090) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZCVD-0005YL-4W for 50967@debbugs.gnu.org; Sat, 09 Oct 2021 09:35:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54990) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mZCV6-00021x-G4; Sat, 09 Oct 2021 09:34:56 -0400 Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:59216 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZCV1-0003Ux-DP; Sat, 09 Oct 2021 09:34:56 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: [bug#50967] file-like objects instead of gexps References: <20211002163834.29583-1-go.wigust@gmail.com> <20211002163834.29583-13-go.wigust@gmail.com> <87pmsnnukj.fsf@yoctocell.xyz> <878rz8q42z.fsf_-_@gnu.org> <87czoilgbg.fsf@trop.in> <87a6jk54ro.fsf@gnu.org> <87ily7hm4x.fsf@trop.in> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 18 =?utf-8?Q?Vend=C3=A9miaire?= 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: Sat, 09 Oct 2021 15:34:48 +0200 In-Reply-To: <87ily7hm4x.fsf@trop.in> (Andrew Tropin's message of "Fri, 08 Oct 2021 13:00:14 +0300") Message-ID: <8735paz5hj.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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50967 Cc: Oleg Pykhalov , Xinglu Chen , 50967@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Andrew, Preamble: Guix Home is now committed and there are bug reports coming in. To me, that means our discussion needs to be focused on addressing specific issues; we=E2=80=99re not going to redesign Guix services in this thread. Andrew Tropin skribis: [...] >> Then that=E2=80=99s fine: you can have special code that emits those =E2= =80=9Csource=E2=80=9D >> lines in .zshrc while still allowing users to provide their own >> file-like object for .zshrc lines they want to add. Again, see how >> =E2=80=98torrc=E2=80=99 is generated in =E2=80=98tor-service-type=E2=80= =99. > > From what I understand you want a separate bashrc-file, > bash-profile-file and bash-logout-file fields to be present, but where > the content of those files should be inserted? At the beginning/end or > instead of the rest of configuration? > > We already can achieve the same result by providing gexp, which will > read the content of the file-like object, a very small helper for that > (slurp-file-gexp) makes it even easier to do. Such approach is more > flexible and doesn't seem much harder. > > I remember that you had concerns about slurp-file-gexp, but still don't > understand what exactly you are concerned about. Let me restate my concerns: 1. Users are unlikely to fathom what this does, given the name. It will end up in user configurations, yet: =E2=80=9Cslurp=E2=80=9D? =E2= =80=9Cgexp=E2=80=9D? 2. =E2=80=98slurp-file-gexp=E2=80=99 returns code, as a gexp. Depending = on the place where that gexp is inserted, it may or may not work. Consider: (define (foo x) #~(frob '(#$x))) (foo (slurp-file-gexp =E2=80=A6)) ;d=E2=80=99oh! 3. Use of =E2=80=98slurp-file-gexp=E2=80=99 and gexps in configuration re= cords is not consistent with the rest of the service APIs (and I think we can humbly recognize that those APIs have been doing the job for a while already.) Let=E2=80=99s just to the (call-with-input-file file get-string-all) dance = in places where it=E2=80=99s needed rather than let users call =E2=80=98slurp-= file-gexp=E2=80=99. This is roughly what the =E2=80=98tor-service-type=E2=80=99 example I gave = does. > I'll write a few examples of service configurations and rationale behind > the design descisions for that next week, to make the discussion more > practically oriented. People are starting to use the tool and to report bugs. So, unfortunately, we have to sort out interface issues quickly now. If some of the things being discussed turn out to be too complex to address under those time constraints, we can consider taking them out until we have a better idea on how to address them. How does that sound? Thanks, Ludo=E2=80=99.