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 KJUhIaLgsGKl4gAAbAwnHQ (envelope-from ) for ; Mon, 20 Jun 2022 23:03:30 +0200 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 qK1RIaLgsGIDBwEAauVa8A (envelope-from ) for ; Mon, 20 Jun 2022 23:03:30 +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 34A423FDC7 for ; Mon, 20 Jun 2022 23:03:30 +0200 (CEST) Received: from localhost ([::1]:44674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3OYT-00066b-DE for larch@yhetil.org; Mon, 20 Jun 2022 17:03:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3OY3-00066P-0S for bug-guix@gnu.org; Mon, 20 Jun 2022 17:03:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3OY2-00054X-K4 for bug-guix@gnu.org; Mon, 20 Jun 2022 17:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o3OY2-0006dq-H1 for bug-guix@gnu.org; Mon, 20 Jun 2022 17:03:02 -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: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 20 Jun 2022 21:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56114 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 56114@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165575893325465 (code B ref -1); Mon, 20 Jun 2022 21:03:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Jun 2022 21:02:13 +0000 Received: from localhost ([127.0.0.1]:58544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3OXE-0006ce-Qf for submit@debbugs.gnu.org; Mon, 20 Jun 2022 17:02:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:52142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3OXC-0006cW-NC for submit@debbugs.gnu.org; Mon, 20 Jun 2022 17:02:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3OXC-000637-Fx for bug-guix@gnu.org; Mon, 20 Jun 2022 17:02:10 -0400 Received: from baptiste.telenet-ops.be ([2a02:1800:120:4::f00:13]:57198) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3OXA-0004vf-74 for bug-guix@gnu.org; Mon, 20 Jun 2022 17:02:10 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id lZ24270084UW6Th01Z24ZW; Mon, 20 Jun 2022 23:02:04 +0200 Message-ID: <1652a111d71c3e74c61904f89120ea45631c7013.camel@telenet.be> From: Maxime Devos Date: Mon, 20 Jun 2022 23:01:54 +0200 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-KA9CCR+UnBW+wAZWZ0PC" 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=1655758924; bh=2cALQUithECPWc4nkVFINi/LkCfbV4DS4fdavZ07MOo=; h=Subject:From:To:Date; b=izMTIfZh0TtD2U2CvPDtYRB5tEGshH8bnTiIqETzyP/1wBhlqzVgpAVrsm2DXC/nX Yc4d4PEwEkq3pCA4heKPVGx+sbtUdUvfEGYKFzDds1T1ItstDAuLjl6y5TbUzqYzmm LwzxrFpzojXVg2F1BO9RUKR5wflzYDFWoBr288NRGvdO/uubXFmL7sKgZp+YiL459G tTwCh28S9ABs2sr42f8f9OLvK75iInAPhNOj1lkA6gHLuQXG6amjhnTJO2u/X1wFaa WC7HKiwLxr1dvjP1cR6tFv5K9hbtgJ8XePfXmjSP8ySlgtfHp3I741iqp7RAkX3AQv Sfeqn5NQhGZMQ== Received-SPF: pass client-ip=2a02:1800:120:4::f00:13; envelope-from=maximedevos@telenet.be; helo=baptiste.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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=1655759010; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=2cALQUithECPWc4nkVFINi/LkCfbV4DS4fdavZ07MOo=; b=aBPYb2WB9DWGS7BqOdj9jfq3FKv80dY9tO0fxSWZdDrNM/Vg4p5Ehm6bAmcPu7y9m7NVG2 VxmkVuwnlWOvS43PYxAL3IZk6C/idVAYkiAoUbm8HdBQ/B2nlxFjr48031B354NeraqVCs E3ha1WYrVnxVR+8Zt3wnfsWQVmqwFzCekn583eDdWZvB5f4kOuYkcofv5bq8rDRMFZVJYl QrGzeTtclJO9NSaDZV2jMChhr0te3z0mqNkVl1rfE7KBvqvRosbQp+uMhJtpcIKWHKF4b6 +cO3INjuDtaGHdmkDg6hEoLUanyL6p5rwEe2SytjffTyjeIN9f/ZmJCtkpwlvQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655759010; a=rsa-sha256; cv=none; b=HXid7PdU37Hxy+IhPpybxRidl87IPo/inqe9lGgQL/m5fw7jXMugrzVtWAHxg0uTdQko92 8Cfhws/CH3MqWan4M02wzU+yZ5cia3N1DN8k2UF+CY9kQh/k4OCny+0qacDiu4wCVtfRTO y22OE8ufD4zhPJEcMfB4gOboWCFGGHEeIEgPBzSJ/B7jWbx+iYr4S6wTAW7rTB5np2P4K7 k+2eCAofVbaehQXMGyvOEXDWZPo+psudNpK6UYUcId6DL9VPZZtYVQ2A8F67s/uFsJFNTj iUEOsMsx0g3HXftrN4vQIJumWVrVM8RGXdLj+B0e3ZYx8cpotULpJR7LtTmUdQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=izMTIfZh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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: 4.63 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=izMTIfZh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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: 34A423FDC7 X-Spam-Score: 4.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: 70ME14+NPTpR --=-KA9CCR+UnBW+wAZWZ0PC Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Variants of this appear repeatedly on #guix every now and then, and also sometimes unasked by me not posted anywhere. How do I run compile a package, computed-file or more generally a lowerable object from the REPL? Let's look in the manual: > Note that the =E2=80=98(guix monad-repl)=E2=80=99 module extends the Guil= e REPL with > new =E2=80=9Cmeta-commands=E2=80=9D to make it easier to deal with monadi= c > procedures: =E2=80=98run-in-store=E2=80=99, and =E2=80=98enter-store-mona= d=E2=80=99. The former is > used to =E2=80=9Crun=E2=80=9D a single monadic value through the store: >=20 > scheme@(guile-user)> ,run-in-store (package->derivation hello) > $1 =3D # ...> >=20 Um, I want the actual store item, not the derivation, and I'm looking into lowering a non-package, let's look elsewhere: > As it turns out, the call to =E2=80=98package->derivation=E2=80=99 can ev= en be > omitted since it will take place implicitly, as we will see later > (*note G-Expressions::): >=20 > (define (sh-symlink) > (gexp->derivation "sh" > #~(symlink (string-append #$bash > "/bin/bash") > #$output))) >=20 > Calling the monadic =E2=80=98sh-symlink=E2=80=99 has no effect. As so= meone once > said, =E2=80=9Cyou exit a monad like you exit a building on fire: by > running=E2=80=9D. So, to exit the monad and get the desired effect, one m= ust > use =E2=80=98run-with-store=E2=80=99: >=20 > (run-with-store (open-connection) (sh-symlink)) > =E2=87=92 /gnu/store/...-sh-symlink Let's try this (using the REPL command): scheme@(guix-user)> ,run-in-store (plain-file "foo" "bar") While executing meta-command: Wrong type to apply: #< name: "foo" content: "bar" references: ()> doesn't work, let's try the 'lower-object' procedure which I vaguely recall to helped me out in the past but doesn't have any actual examples in the manual: scheme@(guix-user)> ,run-in-store (lower-object (plain-file "foo" "bar")) $15 =3D "/gnu/store/798sxvdgr0680czdggbls7rd3sfwk2yx-foo" This looks useful, let's try it for mixed-text-file: scheme@(guix-user)> ,run-in-store (lower-object (mixed-text-file "foo" "bar")) $17 =3D # /gnu/store/raihpcxdz6wmdpyj67bwd4bjk02xq0x3-foo 7f862e53f820> nooo there's the # again how do I get a compiled mixed- text-file from the REPL? (I mean I could use 'build-derivations' from (guix)The Store, but that accepts a list, not an individual derivation, and it doesn't accept strings according to the documentation so it cannot be used for the 'plain-file' and aren't derivations a super-low-level thing for which G-exps and such were intended to make the low level thing almost an implementation detail?) Seems like we are missing a general & documented & simple to use 'lower-object-completely' (or maybe 'compile-object'?) procedure for this ... And maybe also a ,build-object REPL command? Greetings, Maxime. --=-KA9CCR+UnBW+wAZWZ0PC 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+4iGRcl7gUCYrDgQhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lnWAP4t9eKDgA5f5zUxI/tGQAC4cIfQ /eWet8YBdeH0L8X2WQEArAYhoWZtS7vv3AmJ81EZelUMrJUtmO5Jv5zgYlacOgs= =Iq/q -----END PGP SIGNATURE----- --=-KA9CCR+UnBW+wAZWZ0PC--