From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id PQFXGWJzG2HReAEAgWs5BA (envelope-from ) for ; Tue, 17 Aug 2021 10:29:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KCVYFGJzG2EsVwAAbx9fmQ (envelope-from ) for ; Tue, 17 Aug 2021 08:29:22 +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 238651C33B for ; Tue, 17 Aug 2021 10:29:21 +0200 (CEST) Received: from localhost ([::1]:42602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mFuTE-000628-3W for larch@yhetil.org; Tue, 17 Aug 2021 04:29:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFuT1-0005yA-7r for guix-patches@gnu.org; Tue, 17 Aug 2021 04:29:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mFuT0-0005z7-Nb for guix-patches@gnu.org; Tue, 17 Aug 2021 04:29:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mFuT0-00017v-G5 for guix-patches@gnu.org; Tue, 17 Aug 2021 04:29:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48434] [PATCH] guile: allow pre-inst-env inject local paths Resent-From: Sergei Trofimovich Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 17 Aug 2021 08:29: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: Maxime Devos Cc: 48434@debbugs.gnu.org Received: via spool by 48434-submit@debbugs.gnu.org id=B48434.16291889324313 (code B ref 48434); Tue, 17 Aug 2021 08:29:02 +0000 Received: (at 48434) by debbugs.gnu.org; 17 Aug 2021 08:28:52 +0000 Received: from localhost ([127.0.0.1]:51634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFuSh-00017M-7W for submit@debbugs.gnu.org; Tue, 17 Aug 2021 04:28:52 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:44734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFuSd-000177-Kv for 48434@debbugs.gnu.org; Tue, 17 Aug 2021 04:28:42 -0400 Received: by mail-wr1-f53.google.com with SMTP id x12so27322614wrr.11 for <48434@debbugs.gnu.org>; Tue, 17 Aug 2021 01:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=SGmvcJyOw//4KULGHVwXTfF0ywu9A57Mqjkx88uHJgY=; b=O6ZJZm+iN3YFENhdFGL8NRYxpBdAHZFCl+SUy0QtkCkUr+2Dg0J+4THLW272mu0lY4 SrvZ6d9axuYrLJWX8zUzKNcACTWGH/s7DWWoFygssvb35zoCSazW004r3OCEZ8jXWoCi rmvFe3flE8wgcP5W0Pa4HTw1X1CsySEPPNHyBZF5xI8XCkDm9nlyN/JiMvcr6jvd1E6e NPATGfQrsy4ZzJ/DZjdkdEUhxlxrG9VyKVNu+Hun+uj+da0ALt/aBFQdfIQprxRhUX/N qC6JwdfpcWRtlNNiFgDGPJXy5+P33Tp1pmc1j8pNSN+4wCV8e7rvAn/5y+if/LIuEKmv n1vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=SGmvcJyOw//4KULGHVwXTfF0ywu9A57Mqjkx88uHJgY=; b=RqsQo5tRic815MGQjvmru1lp0wyP4PPcCtk3J7B5O6Kjumy0gV9pim1tprU8z20Efr Iksc1TKG6X2ObqPNepeiJCggRGEQ1L7kiEnUyf2ulE52lliM9p7m7R+v1is3v9lo7nMh yGTxuJzoZRZOAZdPFmSuTz/uw0Tsr6PPemmn6hSFQXarPkyGj9fbPDfg0NSpp5xDLREx bfNJR7+WlLYClvqhfGpgAIuuwLajYP5+wgfmH7G+pPlEjU/YkM1bU+o79WFHmxBjZDL1 TCf+4UC2VWQ69oYrw25J1yTFc+rtUUgKCCMDaCfx0220fZImrCG5Z+8dXTBJel/0JmGO BWdA== X-Gm-Message-State: AOAM532TU5VwXE+BAilx3Kdmny383ayVRNLg2VbbHx+mtDd1m9lH+FBq /A29mkcv8DuYpQLsxRWvHXo= X-Google-Smtp-Source: ABdhPJz/T6aUapfDUx07V0vt5WFBRrIJm4r0cQYYE2i9YnJHOpfAGn3F5blB5Yjmly41JOUQdwJcXQ== X-Received: by 2002:adf:f288:: with SMTP id k8mr2508517wro.350.1629188913727; Tue, 17 Aug 2021 01:28:33 -0700 (PDT) Received: from zn3 (host81-129-83-184.range81-129.btcentralplus.com. [81.129.83.184]) by smtp.gmail.com with ESMTPSA id r129sm1327675wmr.7.2021.08.17.01.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 01:28:32 -0700 (PDT) Date: Tue, 17 Aug 2021 09:28:30 +0100 From: Sergei Trofimovich Message-ID: <20210817092830.7a86d795@zn3> In-Reply-To: <430b0e953bf76a13ff2290004d3e7ac1f0bdef7c.camel@telenet.be> References: <20210515095227.3245343-1-slyfox@gentoo.org> <20210816182822.654d3e1f@zn3> <430b0e953bf76a13ff2290004d3e7ac1f0bdef7c.camel@telenet.be> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/+zH9YEm8Mpk6GNrjf_3ofWP"; protocol="application/pgp-signature"; micalg=pgp-sha512 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=1629188961; 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: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=SGmvcJyOw//4KULGHVwXTfF0ywu9A57Mqjkx88uHJgY=; b=L3kgfGeaDbAFYJXGMPMEAyI/z+Lx8sFJQnfRYFBIBDA/+i1QYb+Ey2EwrhDLg+8nZL7CIJ Yv7SmtDz2wf/YFjWyyJG5hL3QPGQRnfRVeOr7f/PSOfqho+B90vlg3pU4aGg1T0WrzG8g3 lef0VLYiNmWhIAVE7efP+T5F5i5q0jkkupC7vNkz/5k5/XGBmA/e8zmdSOG+MXdSVAVt4f dWK+MYQ3RYGBAcHG5qnp9jVA/fp+6DY4TqzPkVeb/hIeIMBedOotnsrW31DeTCCkDHWK4m 7dlSapGiyhLFWDhU/163WD7s28XTsJXJ/Jlo/f//TjlpuspB5RSIErXQ11urqw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629188961; a=rsa-sha256; cv=none; b=uiCilCqHEVdo6/xjI2xWFC3K6mn1XyJJySI6+B4wr3VuJaHu1KLqnp20OMA6edtqhjaNXJ iMXo23t/Hh8rC2mp/PqnaHvHJCnoDHswJ435v3FYCLp2c93U3lvkh/Q4Rq+wgGdToKn4nI hXWKvzcH/AXCHukqtUMN3zLu5RIBScItQvTVMtp6ElhLlYKqKQgq8yI/V30YItDMS7gcMi htYCr3aKnC+2X/HO6FZFQ6j27YoBxlin7kywjtzJyKDq//O59zQHkpXloEBQ1yWWucI+Ii Cbe1ezpJZJQucDrxK8AP/gMO4V0H2HuK+uTOlP5p+GYYbH8flyfBJfzf4k891Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=O6ZJZm+i; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (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: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=O6ZJZm+i; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (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: 238651C33B X-Spam-Score: -2.92 X-Migadu-Scanner: scn1.migadu.com X-TUID: lqi2ImRT/M87 --Sig_/+zH9YEm8Mpk6GNrjf_3ofWP Content-Type: multipart/mixed; boundary="MP_/KvBLaPGTpTNYDfXBv0KwG/w" --MP_/KvBLaPGTpTNYDfXBv0KwG/w Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Mon, 16 Aug 2021 20:52:48 +0200 Maxime Devos wrote: > 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 gi= t 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/pac= kages/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 ign= ored: > The local directory isn't ignored, it's at the end (the effect is about t= he same though). Reworded to: "because local directory override has too low priority". > > > The change keeps GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH for ./pre= -inst-env. > > >=20 > > > * gnu/packages/aux-files/guile-launcher.c (main): don't ignore > > > GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH in GUIX_UNINSTALLED=3D1 mo= de. =20 >=20 > Could you do something like >=20 > #define GUIX_UNINSTALLED 1 > #if GUIX_UNINSTALLED > new behaviour > #else > OLD BEHAVIOUR > #endif >=20 > 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 t= hat? Attached v2 patch that should solve all the above. Added two 'guile' flavours: inplace/guile (to be used inplace) store/guile (to be installed to libexec) While at it moved 'guix-daemon' to 'inplace/' as well to make it clear that tests use inplace variant sometimes. Installation location did not change. Also moved scripts/guix to inplace/guix as ./pre-inst-env relies on it to be injected to PATH. > Also, "guile-launcher.c" is used by 'quiet-quile" in (guix self). It sho= uld probably be > verified that "guix pull" still works well. It's a bit hard to test right now as guix-master is slightly broken due to missing installed files when installed as a primary package manager, but at least fetch part works fine: $ guix pull Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.or= g/git/guix.git'... Authenticating channel 'guix', commits 9edb3f6 to f7094f5 (29 new commits).= .. Building from this channel: guix https://git.savannah.gnu.org/git/guix.git f7094f5 Backtrace: In ice-9/boot-9.scm: 222:29 19 (map1 (((guix store)) ((guix records)) ((guix #)) (#) =E2=80= =A6)) 222:29 18 (map1 (((guix records)) ((guix profiles)) ((guix #)) # =E2=80= =A6)) 222:29 17 (map1 (((guix profiles)) ((guix discovery)) ((guix =E2=80=A6))= =E2=80=A6)) 222:29 16 (map1 (((guix discovery)) ((guix combinators)) ((# =E2=80=A6))= =E2=80=A6)) 222:29 15 (map1 (((guix combinators)) ((guix channels)) ((# #)) =E2=80= =A6)) 222:29 14 (map1 (((guix channels)) ((guix describe)) ((guix #)) =E2=80= =A6)) 222:29 13 (map1 (((guix describe)) ((guix sets)) ((guix ui)) (#) =E2=80= =A6)) 222:29 12 (map1 (((guix sets)) ((guix ui)) ((guix diagnostics)) =E2=80= =A6)) 222:29 11 (map1 (((guix ui)) ((guix diagnostics)) ((guix #)) (#) =E2=80= =A6)) 222:29 10 (map1 (((guix diagnostics)) ((guix modules)) ((# #)) # =E2=80= =A6)) 222:29 9 (map1 (((guix modules)) ((guix packages)) ((guix #)) # =E2=80= =A6)) 222:29 8 (map1 (((guix packages)) ((guix utils)) ((gnu # #)) # =E2=80= =A6)) 222:29 7 (map1 (((guix utils)) ((gnu packages base)) ((gnu =E2=80=A6)) = =E2=80=A6)) 222:29 6 (map1 (((gnu packages base)) ((gnu packages bash)) (#) =E2=80= =A6)) 222:29 5 (map1 (((gnu packages bash)) ((gnu packages hurd)) (#) =E2=80= =A6)) 222:29 4 (map1 (((gnu packages hurd)) ((gnu system setuid)) (#) =E2=80= =A6)) 222:17 3 (map1 (((gnu system setuid)) ((srfi srfi-1)) ((# #)) # =E2=80= =A6)) 3329:6 2 (resolve-interface (gnu system setuid) #:select _ #:hide =E2= =80=A6) 1685:16 1 (raise-exception _ #:continuable? _) 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: no code for module (gnu system setuid) Thanks! --=20 Sergei --MP_/KvBLaPGTpTNYDfXBv0KwG/w Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=v2-0001-guile-allow-pre-inst-env-inject-local-paths.patch =46rom 20fea816b93f31f6b079aa752c0a2ec681649cd0 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 15 May 2021 10:40:12 +0100 Subject: [PATCH v2] guile: allow pre-inst-env inject local paths I observed the problem when tried to run 'guix refresh' from local git chec= kout: $ strace -f ./pre-inst-env guix refresh -u re2c |& fgrep re2c.scm ... [pid 3014757] openat(AT_FDCWD, "/usr/share/guile/site/3.0/gnu/packages/= re2c.scm.qilB0R", O_RDWR|O_CREAT|O_EXCL, 0600) =3D -1 EACCES (Permission denied) Attempt to /usr/share happens because local directory override has too low = priority: $ ./pre-inst-env guile -c '(display (search-path %load-path "gnu/packag= es/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) It happens because ./guile ignores GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PA= TH unconditionally. The change drops 'GUILE_LOAD_PATH' environment variable handling. Instead we bake the constant with into 'guile' binary by distinguishing 'store/guil= e' and 'inplace/guile'. And we bake '%guix-is-inplace' in 'inplace/guix' and in '/usr/bin/guix'. While at it also move 'guix-daemon' to 'inplace/guix-daemon' to make it clear it is used locally by tests. * .gitignore: Ignore new 'store' and 'inplace' directories, ignore two new 'guile-launcher' object files. * Makefile.am: Move 'scripts/guix' to 'inplace/guix'. Move './guile' to 'inplace/guile'. Add 'store/guile' that differes from 'inplace/guile' by absence of '-DGUIX_INPLACE_GUILE=3D1' define. * build-aux/pre-inst-env.in: Don't add '$abs_top_builddir' to the 'PATH'. Add only '$abs_top_builddir/inplace' to the 'PATH'. Drop 'GUIX_UNINSTALLED' environment variable. * build-aux/test-env.in: Update to new 'inplace/guix-daemon' location. * doc/local.mk: Update to new 'inplace/guix-daemon' location. * gnu/packages/aux-files/guile-launcher.c (main): Use compile-time * nix/local.mk: Move 'guix-daemon' to 'inplace/guix-daemon'. 'GUIX_INPLACE_GUILE' define to distinguish 'guile' binary used inplace and used from store. * scripts/guix.in: Drop 'GUIX_UNINSTALLED' environment variable handling in favour of new '%guix-is-inplace' constant. --- .gitignore | 5 ++++- Makefile.am | 29 +++++++++++++++++-------- build-aux/pre-inst-env.in | 12 ++++------ build-aux/test-env.in | 4 ++-- doc/local.mk | 2 +- gnu/packages/aux-files/guile-launcher.c | 26 ++++++++++++++++------ nix/local.mk | 14 ++++++------ scripts/guix.in | 6 +++-- 8 files changed, 61 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 88fe24586d..5a7dfa1f31 100644 --- a/.gitignore +++ b/.gitignore @@ -78,6 +78,7 @@ /etc/openrc/guix-daemon /guix-* /guix/config.scm +/inplace /libformat.a /libstore.a /libutil.a @@ -132,6 +133,7 @@ /pre-inst-env /release-* /scripts/guix +/store /test-env /test-tmp /tests/*.trs @@ -152,5 +154,6 @@ tmp /.version /doc/stamp-* /gnu/packages/bootstrap -/gnu/packages/aux-files/guile-guile-launcher.o +/gnu/packages/aux-files/inplace_guile-guile-launcher.o +/gnu/packages/aux-files/store_guile-guile-launcher.o /guile diff --git a/Makefile.am b/Makefile.am index 5542aa1c56..0666c7b7c2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,33 +33,44 @@ =20 MSGMERGE_UPDATE =3D @MSGMERGE@ --update =20 -bin_SCRIPTS =3D scripts/guix +bin_SCRIPTS =3D inplace/guix =20 # Handle substitution of fully-expanded Autoconf variables. do_subst =3D $(SED) \ -e 's,[@]GUILE[@],$(GUILE),g' \ -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \ -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \ + -e 's,[@]guix_is_inplace[@],t,g' \ -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),g' \ -e 's,[@]localedir[@],$(localedir),g' =20 -scripts/guix: scripts/guix.in Makefile +inplace/guix: scripts/guix.in Makefile $(AM_V_at)rm -f $@ $@-t $(AM_V_at)$(MKDIR_P) "$(@D)" - $(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t" + $(AM_V_GEN)$(do_subst) < "$(srcdir)/$<" > "$@-t" $(AM_V_at)chmod a+x,a-w "$@-t" && mv -f "$@-t" "$@" =20 # This is our variant of the 'guile' executable, one that doesn't complain -# about locales. -pkglibexec_PROGRAMS =3D guile -guile_SOURCES =3D gnu/packages/aux-files/guile-launcher.c -guile_LDADD =3D $(GUILE_LIBS) -guile_CFLAGS =3D $(GUILE_CFLAGS) +# about locales. Intended to be executed from store. +pkglibexec_PROGRAMS =3D store/guile +store_guile_SOURCES =3D gnu/packages/aux-files/guile-launcher.c +store_guile_LDADD =3D $(GUILE_LIBS) +store_guile_CFLAGS =3D $(GUILE_CFLAGS) + +# This is similar to pkglibexec_PROGRAMS with an exception of honoring loc= al +# modules: +# - GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH to allow './pre-inst-env gu= ix refresh' +# and friends access to inplace sources: http://issues.guix.gnu.org/4843= 4. +noinst_PROGRAMS =3D inplace/guile +inplace_guile_SOURCES =3D gnu/packages/aux-files/guile-launcher.c +inplace_guile_LDADD =3D $(GUILE_LIBS) +inplace_guile_CFLAGS =3D $(GUILE_CFLAGS) -DGUIX_INPLACE_GUILE=3D1 =20 # Have the 'guix' command refer to our 'guile'. install-exec-hook: $(SED) -i "$(DESTDIR)$(bindir)/guix" \ - -e 's,^#![[:graph:]]\+,#!$(pkglibexecdir)/guile,g' + -e 's,^#![[:graph:]]\+,#!$(pkglibexecdir)/guile,g' \ + -e 's,define %guix-is-inplace #t,define %guix-is-inplace #f,g' =20 nodist_noinst_SCRIPTS =3D \ pre-inst-env \ diff --git a/build-aux/pre-inst-env.in b/build-aux/pre-inst-env.in index cd90a06cbc..d4e03a92fb 100644 --- a/build-aux/pre-inst-env.in +++ b/build-aux/pre-inst-env.in @@ -39,17 +39,13 @@ export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH =20 # Define $PATH so that `guix' and friends are easily found. =20 -PATH=3D"$abs_top_builddir/scripts:$abs_top_builddir:$PATH" +PATH=3D"$abs_top_builddir/inplace:$PATH" export PATH =20 # The daemon invokes 'guix'; tell it which one to use. -GUIX=3D"$abs_top_builddir/scripts/guix" +# Use inpalce `guix' to honor local GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_= PATH: +# http://issues.guix.gnu.org/48434 +GUIX=3D"$abs_top_builddir/inplace/guix" export GUIX =20 -# Define $GUIX_UNINSTALLED to prevent `guix' from -# prepending @guilemoduledir@ to the Guile load paths. - -GUIX_UNINSTALLED=3D1 -export GUIX_UNINSTALLED - exec "$@" diff --git a/build-aux/test-env.in b/build-aux/test-env.in index 7efc43206c..b41662393d 100644 --- a/build-aux/test-env.in +++ b/build-aux/test-env.in @@ -39,7 +39,7 @@ case "$1" in ;; esac =20 -if [ -x "@abs_top_builddir@/guix-daemon" ] +if [ -x "@abs_top_builddir@/inplace/guix-daemon" ] then NIX_STORE_DIR=3D"@GUIX_TEST_ROOT@/store" =20 @@ -100,7 +100,7 @@ then # Launch the daemon without chroot support because is may be # unavailable, for instance if we're not running as root. "@abs_top_builddir@/pre-inst-env" \ - "@abs_top_builddir@/guix-daemon" --disable-chroot \ + "@abs_top_builddir@/inplace/guix-daemon" --disable-chroot \ --substitute-urls=3D"$GUIX_BINARY_SUBSTITUTE_URL" & =20 daemon_pid=3D$! diff --git a/doc/local.mk b/doc/local.mk index 8340b75a87..6068a2cd2b 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -251,7 +251,7 @@ if !CROSS_COMPILING =20 dist_man1_MANS +=3D $(srcdir)/%D%/guix-daemon.1 =20 -$(srcdir)/%D%/guix-daemon.1: guix-daemon$(EXEEXT) +$(srcdir)/%D%/guix-daemon.1: inplace/guix-daemon$(EXEEXT) -$(AM_V_HELP2MAN)$(gen_man) --output=3D"$@" `basename "$@" .1` =20 endif diff --git a/gnu/packages/aux-files/guile-launcher.c b/gnu/packages/aux-fil= es/guile-launcher.c index 47ba069de1..3dbd738573 100644 --- a/gnu/packages/aux-files/guile-launcher.c +++ b/gnu/packages/aux-files/guile-launcher.c @@ -66,6 +66,12 @@ inner_main (void *unused, int argc, char **argv) int main (int argc, char **argv) { +#if defined(GUIX_INPLACE_GUILE) + int run_guile_from_store =3D 0; +#else + int run_guile_from_store =3D 1; +#endif + /* Try to install the current locale; remain silent if it fails. */ if (setlocale (LC_ALL, "") =3D=3D NULL) /* The 'guix pull'-provided 'guix' includes at least en_US.utf8 so use @@ -73,14 +79,20 @@ main (int argc, char **argv) which is always preferable over the C locale. */ setlocale (LC_ALL, "en_US.utf8"); =20 - const char *str; - str =3D getenv ("GUILE_LOAD_PATH"); - load_path =3D str !=3D NULL ? strdup (str) : NULL; - str =3D getenv ("GUILE_LOAD_COMPILED_PATH"); - load_compiled_path =3D str ? strdup (str) : NULL; =20 - unsetenv ("GUILE_LOAD_PATH"); - unsetenv ("GUILE_LOAD_COMPILED_PATH"); + /* Allow ./pre-inst-env to inject local paths. That way local sources + are preferred for most operations. */ + if (run_guile_from_store) + { + const char *str; + str =3D getenv ("GUILE_LOAD_PATH"); + load_path =3D str !=3D NULL ? strdup (str) : NULL; + str =3D getenv ("GUILE_LOAD_COMPILED_PATH"); + load_compiled_path =3D str ? strdup (str) : NULL; + + unsetenv ("GUILE_LOAD_PATH"); + unsetenv ("GUILE_LOAD_COMPILED_PATH"); + } =20 /* XXX: Do not let GMP allocate via libgc as this can lead to memory corruption in GnuTLS/Nettle since Nettle also uses GMP: diff --git a/nix/local.mk b/nix/local.mk index 7c438ea78c..1d7705b1e5 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -111,33 +111,33 @@ libstore_a_CPPFLAGS =3D \ libstore_a_CXXFLAGS =3D $(AM_CXXFLAGS) \ $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) =20 -bin_PROGRAMS =3D guix-daemon +bin_PROGRAMS =3D inplace/guix-daemon =20 -guix_daemon_SOURCES =3D \ +inplace_guix_daemon_SOURCES =3D \ %D%/nix-daemon/nix-daemon.cc \ %D%/nix-daemon/guix-daemon.cc =20 -guix_daemon_CPPFLAGS =3D \ +inplace_guix_daemon_CPPFLAGS =3D \ -DLOCALEDIR=3D\"$(localedir)\" \ $(libutil_a_CPPFLAGS) \ -I$(top_srcdir)/%D%/libstore =20 -guix_daemon_LDADD =3D \ +inplace_guix_daemon_LDADD =3D \ libstore.a libutil.a libformat.a -lz \ $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) =20 -guix_daemon_headers =3D \ +inplace_guix_daemon_headers =3D \ %D%/nix-daemon/shared.hh =20 if HAVE_LIBBZ2 =20 -guix_daemon_LDADD +=3D -lbz2 +inplace_guix_daemon_LDADD +=3D -lbz2 =20 endif HAVE_LIBBZ2 =20 noinst_HEADERS =3D \ $(libformat_headers) $(libutil_headers) $(libstore_headers) \ - $(guix_daemon_headers) + $(inplace_guix_daemon_headers) =20 %D%/libstore/schema.sql.hh: guix/store/schema.sql $(AM_V_GEN)$(GUILE) --no-auto-compile -c \ diff --git a/scripts/guix.in b/scripts/guix.in index e0194d6ea2..a9fc29baa4 100644 --- a/scripts/guix.in +++ b/scripts/guix.in @@ -1,4 +1,4 @@ -#!@abs_top_builddir@/guile \ +#!@abs_top_builddir@/inplace/guile \ --no-auto-compile -e main -s !# ;;; GNU Guix --- Functional package management for GNU @@ -31,8 +31,10 @@ (push! "@guilemoduledir@" %load-path) (push! "@guileobjectdir@" %load-compiled-path)) =20 +(define %guix-is-inplace #@guix_is_inplace@) + (define* (main #:optional (args (command-line))) - (unless (getenv "GUIX_UNINSTALLED") + (unless %guix-is-inplace (augment-load-paths!)) =20 (let ((guix-main (module-ref (resolve-interface '(guix ui)) --=20 2.32.0 --MP_/KvBLaPGTpTNYDfXBv0KwG/w-- --Sig_/+zH9YEm8Mpk6GNrjf_3ofWP Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQKTBAEBCgB9FiEE+g11JqJ4cL44QkmN7V5F4G8qwpMFAmEbcy5fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEZB MEQ3NTI2QTI3ODcwQkUzODQyNDk4REVENUU0NUUwNkYyQUMyOTMACgkQ7V5F4G8q wpNFdw//XKDejSC5UcZ0uGEqXcpWL8Cz+RjiXFHOqQBZR7grr4EV3cME6GSONBe9 jgKXhO44xJa2+uv5IRFGqWNqcwKThFZw4Is4cOfkNxKI2BL5/AMXJOmoYV5aARRf jE/UxkI3DplzB69d5iWbUmRwzFUk0FB88hxchjxmfl0pvmUV1KEdBv75rwaGALlE KbcVJWVhOeoVTDIYNLpLuIHjpE4xIYSOYEaeLBCzlUERYw0ddI3dj/PBGL1QOSlK xoyRctXBzO/LglKJv9AaA++Lbx3+GdxrXTxijRfLPsJFfm/CDVr5Z/l742URZ8Mv fLxKGuA5EflTGR37wf192+8kPNgdVBIes2aoQMxmbkBk39u1jWmUvflYSHVKCRvm jde9ctTO/ZdxRFL34VPHXspCSSe7s84ZFz67Pj/BBwG6+1vud45XacHxDpOeCQRD NFRofFF1FOhIm7mJEwxbfTu1mtCPcavhSehXhkha1EghychYJS/65P4THz0qZ9qh DlxjNpBRa73tCuJ12jYpgGr5bU0QInhbM+YRt+cZ5sQQHjs0kMhay9y0WabM+VPy Dn1cbxhxqXWNPmjpD2iQNukAeD3bmb/vwCXrw0OGDgus5vtN5yFo5FiJTjsEhWKg PxjclmWVgFD49ww70doX570+0vI/ufnrraFP5Qzbancy2hQKbKw= =Pz9u -----END PGP SIGNATURE----- --Sig_/+zH9YEm8Mpk6GNrjf_3ofWP--