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 ms0.migadu.com with LMTPS id kMkjKPkw22HxOAEAgWs5BA (envelope-from ) for ; Sun, 09 Jan 2022 20:01:13 +0100 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 WHx0Jfkw22ECHAAA9RJhRA (envelope-from ) for ; Sun, 09 Jan 2022 20:01:13 +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 41E6532C0D for ; Sun, 9 Jan 2022 20:01:13 +0100 (CET) Received: from localhost ([::1]:34248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6dRI-0005OH-BN for larch@yhetil.org; Sun, 09 Jan 2022 14:01:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6dR0-0005Nj-NL for guix-devel@gnu.org; Sun, 09 Jan 2022 14:00:54 -0500 Received: from [2a02:1800:110:4::f00:1a] (port=42922 helo=albert.telenet-ops.be) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6dQy-0004bz-7O for guix-devel@gnu.org; Sun, 09 Jan 2022 14:00:54 -0500 Received: from [172.20.10.5] ([188.188.180.65]) by albert.telenet-ops.be with bizsmtp id gj0l2600A1R3YAc06j0ooC; Sun, 09 Jan 2022 20:00:49 +0100 Message-ID: Subject: Re: Return back original implementation for text-config serialization From: Maxime Devos To: Andrew Tropin , guix-devel@gnu.org, Oleg Pykhalov , Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Sun, 09 Jan 2022 20:00:40 +0100 In-Reply-To: <87y23o3i3p.fsf@trop.in> References: <878rvp1deg.fsf@trop.in> <0802f1bb7418b0b3458c5beb008f4c8dc6fc120c.camel@telenet.be> <87y23o3i3p.fsf@trop.in> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-U5ZlcdmZLs056Cy7g6xD" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641754849; bh=mKq3tnoYo/3w7vGCcPlAEe3MsiZgiRhq9SnvHEKq2E4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=dfrcFTr3EqVP8u7HPIbzEbKKim4clZ4ne8rxiShBcQkiUqFjQ8ZSgG3Se17xezKoR tL3jorFTFavwxUn5MJIc6tIedupUyxnUcxoih14Hek3YxHGXkWfGJc+POaScJ1i9Q6 aaEY4dqL7gknXKym3W9c5ESI1o/3EXPMCFPXc9BtyDZgPPIIgHcqMWURnN2bJAONH7 k1etHXge5BI7kafn8NICCE2jjpStsrwh0YazEPC5kf9eY68orrCcq/MP8h3p668qgP C77tdY1+IeWwMm/tlYaX2LyHY/ZVzw8qGEcUQ8BOql5LCLfNVccbFt/q01yLD1LeBT /Efr0E0K3/tiA== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:1800:110:4::f00:1a (failed) Received-SPF: pass client-ip=2a02:1800:110:4::f00:1a; envelope-from=maximedevos@telenet.be; helo=albert.telenet-ops.be X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xinglu Chen , guix-maintainers@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" 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=1641754873; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=mKq3tnoYo/3w7vGCcPlAEe3MsiZgiRhq9SnvHEKq2E4=; b=VB3ajiSuTxJYk0YzogQzBrtNd2jXgon59+G1ZkBcm1qCTjO5w95NEdl0uPcmgMk5IwX+LG rG3l92yoE140GaLYVI1+Lei5BCikPy+U6YRgaWEUyZNBrBSGv3EA/QpkADZMK3Z3T7R5fL UhL1sYwhLABQLxXre5y2hxUh9Q56o2JxNjmcdmDdNm2fWBFnRk987TSZx5BJ4R/cnu+dBi fKBT7FyHUEzzf9JzSEGGtS7MMPdl+kb+4whDA1hhCE1Tst1yxsTiYi1m4lCR4sDCXpzHAb rzI/9hU9a5MDEhi7moXF3O3V83oYLuWx9yOKhKYc/p2qNP9pFxXwHiVzfBD1Zg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641754873; a=rsa-sha256; cv=none; b=mbnIwQ4MmOKD64zCsR33RkV4B4NMubopoYZWbMoglnJXy2dcl2agi7zDFWnZUS4zl772ao YwExOf29GYZ9PzF7wkOaUDowLJjV250clpKdMXHE+VdKuxqrG3j01666AVcHkvMiZeV/WX bcCuDeSvGke5caIYO984fSm/WefRjLG6noKEGrxxmXCpaPdwtk5uoj2Nj8f5HnLrCqufZL /aNJII9kw/bm0duVCZ535SHPsOGXcCmsA9T/m3tMePxPVkiuen8cEGzNJnjXOp7l/oZ7EG V3CHj9JU4Eo7WPAzVMUZxEpPI7KwVH41gov/7SU4jQq/wDlR7/+36fO26+Ja6w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r22 header.b=dfrcFTr3; dmarc=pass (policy=none) header.from=telenet.be; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.01 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r22 header.b=dfrcFTr3; dmarc=pass (policy=none) header.from=telenet.be; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 41E6532C0D X-Spam-Score: -6.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: wpkHfaZihavN --=-U5ZlcdmZLs056Cy7g6xD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Andrew Tropin schreef op zo 09-01-2022 om 20:59 [+0300]: > [...] > I think we can just rely on something like that: > --8<---------------cut here---------------start------------->8--- > #~(call-with-input-file #$(local-file "./files/bashrc") > =C2=A0=C2=A0=C2=A0=C2=A0(@ (ice-9 textual-ports) get-string-all)) > --8<---------------cut here---------------end--------------->8--- >=20 > As I mentioned in reply to Liliana, from my experience it's a rare case, > when we really need to slurp the content of the file, in most cases > include/source and other similar consturctions can do the trick, so it > maybe not necessary to have a helper for this case at all. >=20 > WDYT? >=20 > BTW, even after reading "Code Staging in GNU Guix" paper, I still not > sure what the problem with slurp-file-gexp (except maybe name :) ). Looking at the reasons at , the issue seems mostly naming to me. When I read 'slurp-file-gexp', what I thought was happening, is that first the file-like object is lowered and then the G-Exp of the builder is extracted from the derivation. Maybe name it (define (file-contents object) "Construct a G-expression that reads the file-like object OBJECT and returns the contents as a string." ;; TODO: do we need to set the encoding to UTF-8 here? #~((@ (relevant guile module) call-with-input-file) #$object (@ (ice-9 textual-ports) get-string-all))) That would avoid having to remember the (call-with-input-file ...) trick. Greetings, Maxime. --=-U5ZlcdmZLs056Cy7g6xD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdsw2BccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7vYOAQCKx22pkl1a15r/4krjrjnUrFNJ fSK6WYzOMAjmYRMlZwEAuUt43RVyXNKcr0Hxh1kOHapczAUuEzyFPOp7KxyPbAQ= =RSA5 -----END PGP SIGNATURE----- --=-U5ZlcdmZLs056Cy7g6xD--