From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4Ie+C1O0GmFVIwAAgWs5BA (envelope-from ) for ; Mon, 16 Aug 2021 20:54:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id IAV0B1O0GmHwUQAAB5/wlQ (envelope-from ) for ; Mon, 16 Aug 2021 18:54:11 +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 8242EDE4D for ; Mon, 16 Aug 2021 20:54:10 +0200 (CEST) Received: from localhost ([::1]:43594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mFhkP-0003hd-1z for larch@yhetil.org; Mon, 16 Aug 2021 14:54:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFhkI-0003hH-O1 for guix-patches@gnu.org; Mon, 16 Aug 2021 14:54:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mFhkI-000666-HN for guix-patches@gnu.org; Mon, 16 Aug 2021 14:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mFhkI-0003tz-GA for guix-patches@gnu.org; Mon, 16 Aug 2021 14:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48434] [PATCH] guile: allow pre-inst-env inject local paths Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Aug 2021 18:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48434 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sergei Trofimovich , 48434@debbugs.gnu.org Received: via spool by 48434-submit@debbugs.gnu.org id=B48434.162913998814922 (code B ref 48434); Mon, 16 Aug 2021 18:54:02 +0000 Received: (at 48434) by debbugs.gnu.org; 16 Aug 2021 18:53:08 +0000 Received: from localhost ([127.0.0.1]:50985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFhjH-0003sA-Dz for submit@debbugs.gnu.org; Mon, 16 Aug 2021 14:53:08 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:34650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFhjD-0003rz-5a for 48434@debbugs.gnu.org; Mon, 16 Aug 2021 14:52:58 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by michel.telenet-ops.be with bizsmtp id iJst2500N0mfAB406JstuL; Mon, 16 Aug 2021 20:52:53 +0200 Message-ID: <430b0e953bf76a13ff2290004d3e7ac1f0bdef7c.camel@telenet.be> From: Maxime Devos Date: Mon, 16 Aug 2021 20:52:48 +0200 In-Reply-To: <20210816182822.654d3e1f@zn3> References: <20210515095227.3245343-1-slyfox@gentoo.org> <20210816182822.654d3e1f@zn3> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-d0Mlw//aovHJZ5t/P6Ax" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1629139973; bh=oDLXYlPwen2JQZDin5Mp9ZGoRECElaKbFuP1YYPYnTE=; h=Subject:From:To:Date:In-Reply-To:References; b=k4e91VMJvJvNh2/qh/oJXuWh+8MFbKjaF9isDIynGdK39Gq/OeN8EuaPLYsmQs4rU bzeJ4H0BjDdNAXbul1MSQdTjDd8GX4UNIfNskHG94y/i5o+SC4s4i7fvK9I0eEy9AC iUOY/avb0Yfy1s46ulyHP9u+TohhxAj5v8sMy7cHrI71bzCe2lWMZKlWhr+0Iad0oW 7MBGfjwCGQF0zOhWFRfTOHDhZstKPdG9sddG3NMF3vYG1P3KwCQiY0KPruhtR/FfwM LNfcZt7LTEsfE46/a9ZIkF6pxkjN/94HHdHkMemUlJrH7LeZyHgoD2dJ0obaCCvjN8 fJmfzzhKkgeRA== 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1629140050; 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:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=oDLXYlPwen2JQZDin5Mp9ZGoRECElaKbFuP1YYPYnTE=; b=YvzIYO/FnZvNC7AuEmJsWwyibPFGlIrVEiRz+9ph7QaxegqHIjvAdHwCNAVY76mH7tRaD0 efOv0uPea3upgg158I0pLjj+ZG6FRvDiTNPKXoLwTLjN3PM3tJGDuBpDGsI94udrw/J4J8 EHszIje77eJyPhzG8PHTJwHK7v0DrEyTrtKH28qrnmjfMmbHxkjr81ikAgbA3sXU1ifwck C8m0rJxFSrRKIYKxrnL1eIAI1xvOfM0f0hnmQVhIbx7OjHzWOidq3Ja7WDUJbP/TyS3xvD jYTmuzJcbnWkcxrtuksA4RgjUIFS3eM1/LsCNENoG/5qaThF78oz8ZjM/SzZig== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629140050; a=rsa-sha256; cv=none; b=Ul4EiiJX2PHajQATWXUXUhNAo0kPuUQ8O8S1U1Ex42T/qU7dfkO9Uuq94+dmnHcKVXNSdN q5KcQ0a8vhJCGmT2kY7Qo/gzcsO/gEiHa4m2lt3UmH50ew8qZyk2FvaTrOLxtAuaKSkA9E YuENUM840h4YR4T8A9B2SIYShzmiI4RZQr6wBI2wpDmvxFOZJqXzHf+TTt/P32bkPOC60a xng+KJHwW/PNlr0P365BgQkKtuG0Os7UJ4MhZULkSfDpp17L2FiFd13uXB8kTyWScE1QzS uq4sVBupDejWejWsOhSNgs0AVEGt0tXWiTM4NaEX5pXGwrYuO6UhVXKBDeWInA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=k4e91VMJ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.41 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=k4e91VMJ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 8242EDE4D X-Spam-Score: -3.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: 05YWI0qbfvkZ --=-d0Mlw//aovHJZ5t/P6Ax Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sergei Trofimovich schreef op ma 16-08-2021 om 18:28 [+0100]: > On Sat, 15 May 2021 10:52:27 +0100 > Sergei Trofimovich wrote: >=20 > > I observed the problem when tried to run 'guix refresh' from local git = checkout: > >=20 > > $ strace -f ./pre-inst-env guix refresh -u re2c |& fgrep re2c.scm > > ... > > [pid 3014757] openat(AT_FDCWD, "/usr/share/guile/site/3.0/gnu/packa= ges/re2c.scm.qilB0R", > > O_RDWR|O_CREAT|O_EXCL, 0600) =3D -1 EACCES (Permission denied) > >=20 > > Attempt to /usr/share happens because local directory override is ignor= ed: > >=20 > > $ ./pre-inst-env guile -c '(display (search-path %load-path "gnu/pa= ckages/re2c.scm")) (newline) (display %load-path) (newline)' > > /usr/share/guile/site/3.0/gnu/packages/re2c.scm > > (/usr/share/guile/3.0 \ > > /usr/share/guile/site/3.0 \ > > /usr/share/guile/site \ > > /usr/share/guile \ > > /home/slyfox/dev/git/guix \ > > /home/slyfox/dev/git/guix) ^ here's the checkout in the load path > >=20 > > It happens because ./guile ignores GUILE_LOAD_PATH / GUILE_LOAD_COMPILE= D_PATH > > unconditionally. The local directory isn't ignored, it's at the end (the effect is about the= same though). > > The change keeps GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH for ./pre-i= nst-env. > >=20 > > * gnu/packages/aux-files/guile-launcher.c (main): don't ignore > > GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH in GUIX_UNINSTALLED=3D1 mode= . Could you do something like #define GUIX_UNINSTALLED 1 #if GUIX_UNINSTALLED new behaviour #else OLD BEHAVIOUR #endif and change "Makefile.am" to compile two variants of "guile", one with "DGUIX_UNINSTALLED=3D1" which goes into libexec, and another with "DGUIX_UNINSTALLED=3D0" named "$CHECKOUT/guile" which isn't installed anywhere but will be added to PATH by "pre-inst-env", or something like tha= t? I've a bit of an aversion towards using $..._UNINSTALLED environment variab= les, as it leads to difficult situations like =E2=80=98what should happen if I /= gnu/store/.../bin/guix is run with GUIX_UNINSTALLED set to 1=E2=80=99: (a): Reset "GUILE_LOAD{,_COMPILED}_PATH" because we're running directly f= rom the store (b): Don't reset "GUILE_LOAD_{,_COMPILED}_PATH" because GUIX_UNINSTALLED = is set to 1. As a comparison, GUIX_UNINSTALLED, the preprocessor variable, is like a =E2= =80=98lexical variable=E2=80=99, and GUIX_UNINSTALLED, the environment variable, is like a =E2=80=98parameter object=E2=80=99/=E2=80=98dynamically bound variable=E2= =80=99 (see, e.g., 6.11.12 Parameters in the Guile manual). I tend to prefer the former, except for dynamic things like LC_AL= L, $[...]_PATH (when used by "guile", "gcc" -- applications typically shouldn't depend on = $GUILE_LOAD_PATH, if they do, they need 'wrap-program' or the like=E2=80=99). Also, "guile-launcher.c" is used by 'quiet-quile" in (guix self). It shoul= d probably be verified that "guix pull" still works well. Greetings, Maxime. --=-d0Mlw//aovHJZ5t/P6Ax 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+4iGRcl7gUCYRq0ABccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7u7dAP9nyeKHaysuBDca+a/M++uXSwnB KuxMRdGln5+HLg/dJgEArmz16fXyIH98bXEO/VAu3uc7l/Mk5c9cdYsIDx9XqAM= =ipRd -----END PGP SIGNATURE----- --=-d0Mlw//aovHJZ5t/P6Ax--