From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id OOvVGpnSzF6OOQAA0tVLHw (envelope-from ) for ; Tue, 26 May 2020 08:26:01 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yAanFpnSzF4TRgAAbx9fmQ (envelope-from ) for ; Tue, 26 May 2020 08:26:01 +0000 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 3C1C5940365 for ; Tue, 26 May 2020 08:26:00 +0000 (UTC) Received: from localhost ([::1]:48230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdUuM-0003un-UJ for larch@yhetil.org; Tue, 26 May 2020 04:25:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdUu4-0003uO-Ms for help-guix@gnu.org; Tue, 26 May 2020 04:25:40 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:42197) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdUu3-00084x-Jn for help-guix@gnu.org; Tue, 26 May 2020 04:25:40 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 8561E5C0042; Tue, 26 May 2020 04:25:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 26 May 2020 04:25:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.net; h= from:to:subject:in-reply-to:references:cc:cc:cc:date:message-id :mime-version:content-type:content-transfer-encoding; s=fm3; bh= 2fijVvg4VZ0UK3N6iemWmN5UGPrMZB0mEkzrA9neGus=; b=GB0z9rr9SIGf1XJW P3FQrqBqNJlSO26Qlz6J9eromxMLIli+kRmL0+IKSpVaoGc4LiTSiMWWCGdkCrr2 Hzi0/nWTT9B7K4b3S4uKDapuCUY1syVo9xh6ZgeaxIXRESaCzQRG2HbrWDiT6Uqb eFpqE3OaD8Dy3aRpyPwcq1jYUZug2MHgQxIhjlBpVA8w7IoZY2GaNBWhT7ohS6dI 6aC3tAS5jNuKctTBc/gzcpI7QhYRNfTqwHIn7Rvy8yq2+IfVbAxMj0+sAR1t07xj wuEEskXFwc59JV4PLlVtCSXAJbrTm90kcLKCmEpSwtjDn2n6CK7f7sUAML4ziHzY TGoOvg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:cc:content-transfer-encoding :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=2fijVvg4VZ0UK3N6iemWmN5UGPrMZ B0mEkzrA9neGus=; b=OsKQrgkTZxohaCB6tgZUBp1FsDHwDnWtrsPvbbXmL7KJV 6cUE0LyBA19VGpa+KPRoInq8tmY+X+VgdAegyRaVUKfiyOVLAy7Ilwjt9yTMCLVP NF5hQM0gl7foxAKXZ0x7ZlBn+uESdcrJOe3iKBy7zNpE0g4M1SruDgq+WwYTdqBl KWDdcthBQMHyKrT+PNmKn8jRxS6m/OwCkgGOJFR0kTLLPsEyho91M7N+IPP6Pous 0g6JK9qlyRyBrA+Ww5usL4Yii8M8CLHowpFaDyM5SgCfS4iMDvzIfykpE04dHf2m pM7dstlxYo25Jyl3YMZPSEFftlcE9h8bNbBMMwx8w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddvvddgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhffkfggtgfgsehtqhertddttdejnecuhfhrohhmpefmohhnrhgr ugcujfhinhhsvghnuceokhhonhhrrggurdhhihhnshgvnhesfhgrshhtmhgrihhlrdhnvg htqeenucggtffrrghtthgvrhhnpeevheelveegjeduvdfgudeifeevteffvdetgeefkefg udeujeefgedvheegkefhjeenucfkphepledvrdduieelrddujeefrddvvdehnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepkhhonhhrrggurdhh ihhnshgvnhesfhgrshhtmhgrihhlrdhnvght X-ME-Proxy: Received: from khs-macbook.home (lfbn-idf2-1-1364-225.w92-169.abo.wanadoo.fr [92.169.173.225]) by mail.messagingengine.com (Postfix) with ESMTPA id 4EC943280060; Tue, 26 May 2020 04:25:36 -0400 (EDT) From: Konrad Hinsen To: Guix Help Subject: Re: Appropriate way to use Guix API from a Guile program In-Reply-To: References: <17234059da3.b5e01d1e8240.9032082708652182693@zoho.com> <878shla245.fsf@devup.no> <17238fa6f3f.1085042d523521.3962992471488424781@zoho.com> <87tv0980yc.fsf@devup.no> Date: Tue, 26 May 2020 10:25:35 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=66.111.4.26; envelope-from=konrad.hinsen@fastmail.net; helo=out2-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/26 04:25:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=fastmail.net header.s=fm3 header.b=GB0z9rr9; dkim=fail (rsa verify failed) header.d=messagingengine.com header.s=fm2 header.b=OsKQrgkT; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fastmail.net (policy=none); spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: yV6KSb3+DwHu Hi everyone, zimoun writes: >> Thanks for the reminder that my "guix repl" patch needs more work - it >> should accept command line arguments for the script. Something like >> >> guix repl foo.scm =E2=80=93- [ARGS] >> >> should be easily doable, and fits in with existing conventions. > > It could be really cool! :-) Unfortunately, it doesn't look as straightforward as I thought. A standard Guile script retrieves command line arguments using (command-line). "guix repl" should ideally manipulate the return value of (command-line) to make things just work, but I haven't found a way to do this. The other solution is to define a command-line interface specifically for scripts run using "guix repl", which looks like a lot of effort for a less-than-optimal result. Alex Sassmannshausen writes: > I can't help but think that it would be really useful to have a way to > inject these load paths into the general user environment, in a way > similar to `guix package --search-paths', so that the currently pulled > guix can be just another guile library to be used on the system like > any other. I don't see any other way to do this than to shell out to "guix", parse the return value, and modify load-path. Certainly doable, but I am not sure it's worth the effort. The problem with Guix is that are so many of it. Most users have a single Guix version that they update using "guix pull", but others also use development branches compiled locally and invoked via the pre=E1=B5=A2n= st=E2=82=91nv script. In the end it's the user who picks the right Guix for the job at the command line. Any Guile script referring to Guix should offer the same flexibility. sirgazil writes: > And if you wanted to run the script without typing "guix repl", what woul= d be > the first line of the script. This? > > #!~/.config/guix/current/bin/guix repl > !# I'd go for=20 > #!/bin/env guix repl > !# or something like that. I suspect it requires some more incantation magic to work. Cheers, Konrad