GNU bug report logs - #48434
[PATCH] guile: allow pre-inst-env inject local paths

Previous Next

Package: guix-patches;

Reported by: Sergei Trofimovich <slyfox <at> gentoo.org>

Date: Sat, 15 May 2021 09:53:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 48434 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#48434; Package guix-patches. (Sat, 15 May 2021 09:53:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sergei Trofimovich <slyfox <at> gentoo.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 15 May 2021 09:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sergei Trofimovich <slyfox <at> gentoo.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Sergei Trofimovich <slyfox <at> gentoo.org>
Subject: [PATCH] guile: allow pre-inst-env inject local paths
Date: Sat, 15 May 2021 10:52:27 +0100
I observed the problem when tried to run 'guix refresh' from local git checkout:

    $ 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) = -1 EACCES (Permission denied)

Attempt to /usr/share happens because local directory override is ignored:

    $ ./pre-inst-env guile -c '(display (search-path %load-path "gnu/packages/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_PATH
unconditionally.

The change keeps GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH for ./pre-inst-env.

* gnu/packages/aux-files/guile-launcher.c (main): don't ignore
GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH in GUIX_UNINSTALLED=1 mode.

Signed-off-by: Sergei Trofimovich <slyfox <at> gentoo.org>
---
 gnu/packages/aux-files/guile-launcher.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/aux-files/guile-launcher.c b/gnu/packages/aux-files/guile-launcher.c
index 47ba069de1..bed63353a9 100644
--- a/gnu/packages/aux-files/guile-launcher.c
+++ b/gnu/packages/aux-files/guile-launcher.c
@@ -73,14 +73,19 @@ main (int argc, char **argv)
        which is always preferable over the C locale.  */
     setlocale (LC_ALL, "en_US.utf8");
 
-  const char *str;
-  str = getenv ("GUILE_LOAD_PATH");
-  load_path = str != NULL ? strdup (str) : NULL;
-  str = getenv ("GUILE_LOAD_COMPILED_PATH");
-  load_compiled_path = str ? strdup (str) : NULL;
+  /* Allow ./pre-inst-env to inject local paths. That way local sources
+     are preferred for most operations.  */
+  if (getenv ("GUIX_UNINSTALLED") == NULL)
+    {
+      const char *str;
+      str = getenv ("GUILE_LOAD_PATH");
+      load_path = str != NULL ? strdup (str) : NULL;
+      str = getenv ("GUILE_LOAD_COMPILED_PATH");
+      load_compiled_path = str ? strdup (str) : NULL;
 
-  unsetenv ("GUILE_LOAD_PATH");
-  unsetenv ("GUILE_LOAD_COMPILED_PATH");
+      unsetenv ("GUILE_LOAD_PATH");
+      unsetenv ("GUILE_LOAD_COMPILED_PATH");
+    }
 
   /* XXX: Do not let GMP allocate via libgc as this can lead to memory
      corruption in GnuTLS/Nettle since Nettle also uses GMP:
-- 
2.31.1





Information forwarded to guix-patches <at> gnu.org:
bug#48434; Package guix-patches. (Mon, 16 Aug 2021 17:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 48434 <at> debbugs.gnu.org (full text, mbox):

From: Sergei Trofimovich <slyich <at> gmail.com>
To: 48434 <at> debbugs.gnu.org
Subject: Re: [PATCH] guile: allow pre-inst-env inject local paths
Date: Mon, 16 Aug 2021 18:28:31 +0100
On Sat, 15 May 2021 10:52:27 +0100
Sergei Trofimovich <slyfox <at> gentoo.org> wrote:

> I observed the problem when tried to run 'guix refresh' from local git checkout:
> 
>     $ 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) = -1 EACCES (Permission denied)
> 
> Attempt to /usr/share happens because local directory override is ignored:
> 
>     $ ./pre-inst-env guile -c '(display (search-path %load-path "gnu/packages/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_PATH
> unconditionally.
> 
> The change keeps GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH for ./pre-inst-env.
> 
> * gnu/packages/aux-files/guile-launcher.c (main): don't ignore
> GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH in GUIX_UNINSTALLED=1 mode.
> 
> Signed-off-by: Sergei Trofimovich <slyfox <at> gentoo.org>
> ---
>  gnu/packages/aux-files/guile-launcher.c | 19 ++++++++++++-------
>  1 file changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/gnu/packages/aux-files/guile-launcher.c b/gnu/packages/aux-files/guile-launcher.c
> index 47ba069de1..bed63353a9 100644
> --- a/gnu/packages/aux-files/guile-launcher.c
> +++ b/gnu/packages/aux-files/guile-launcher.c
> @@ -73,14 +73,19 @@ main (int argc, char **argv)
>         which is always preferable over the C locale.  */
>      setlocale (LC_ALL, "en_US.utf8");
>  
> -  const char *str;
> -  str = getenv ("GUILE_LOAD_PATH");
> -  load_path = str != NULL ? strdup (str) : NULL;
> -  str = getenv ("GUILE_LOAD_COMPILED_PATH");
> -  load_compiled_path = str ? strdup (str) : NULL;
> +  /* Allow ./pre-inst-env to inject local paths. That way local sources
> +     are preferred for most operations.  */
> +  if (getenv ("GUIX_UNINSTALLED") == NULL)
> +    {
> +      const char *str;
> +      str = getenv ("GUILE_LOAD_PATH");
> +      load_path = str != NULL ? strdup (str) : NULL;
> +      str = getenv ("GUILE_LOAD_COMPILED_PATH");
> +      load_compiled_path = str ? strdup (str) : NULL;
>  
> -  unsetenv ("GUILE_LOAD_PATH");
> -  unsetenv ("GUILE_LOAD_COMPILED_PATH");
> +      unsetenv ("GUILE_LOAD_PATH");
> +      unsetenv ("GUILE_LOAD_COMPILED_PATH");
> +    }
>  
>    /* XXX: Do not let GMP allocate via libgc as this can lead to memory
>       corruption in GnuTLS/Nettle since Nettle also uses GMP:

Stumbled on it again today when cloned fresh guix repo and forgot to
apply this patch. Is it a reasonable approach? Or something else is
at fault here?

Thanks!

-- 

  Sergei




Information forwarded to guix-patches <at> gnu.org:
bug#48434; Package guix-patches. (Mon, 16 Aug 2021 18:54:02 GMT) Full text and rfc822 format available.

Message #11 received at 48434 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Sergei Trofimovich <slyich <at> gmail.com>, 48434 <at> debbugs.gnu.org
Subject: Re: [bug#48434] [PATCH] guile: allow pre-inst-env inject local paths
Date: Mon, 16 Aug 2021 20:52:48 +0200
[Message part 1 (text/plain, inline)]
Sergei Trofimovich schreef op ma 16-08-2021 om 18:28 [+0100]:
> On Sat, 15 May 2021 10:52:27 +0100
> Sergei Trofimovich <slyfox <at> gentoo.org> wrote:
> 
> > I observed the problem when tried to run 'guix refresh' from local git checkout:
> > 
> >     $ 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) = -1 EACCES (Permission denied)
> > 
> > Attempt to /usr/share happens because local directory override is ignored:
> > 
> >     $ ./pre-inst-env guile -c '(display (search-path %load-path "gnu/packages/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

> > 
> > It happens because ./guile ignores GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_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-inst-env.
> > 
> > * gnu/packages/aux-files/guile-launcher.c (main): don't ignore
> > GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH in GUIX_UNINSTALLED=1 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=1" which goes into libexec, and another
with "DGUIX_UNINSTALLED=0" named "$CHECKOUT/guile" which isn't installed
anywhere but will be added to PATH by "pre-inst-env", or something like that?

I've a bit of an aversion towards using $..._UNINSTALLED environment variables,
as it leads to difficult situations like ‘what should happen if I /gnu/store/.../bin/guix
is run with GUIX_UNINSTALLED set to 1’:

  (a): Reset "GUILE_LOAD{,_COMPILED}_PATH" because we're running directly from 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 ‘lexical variable’,
and GUIX_UNINSTALLED, the environment variable, is like a
‘parameter object’/‘dynamically bound variable’ (see, e.g., 6.11.12 Parameters in the Guile
manual).  I tend to prefer the former, except for dynamic things like LC_ALL, $[...]_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’).

Also, "guile-launcher.c" is used by 'quiet-quile" in (guix self).  It should probably be
verified that "guix pull" still works well.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#48434; Package guix-patches. (Tue, 17 Aug 2021 08:29:02 GMT) Full text and rfc822 format available.

Message #14 received at 48434 <at> debbugs.gnu.org (full text, mbox):

From: Sergei Trofimovich <slyich <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 48434 <at> debbugs.gnu.org
Subject: Re: [bug#48434] [PATCH] guile: allow pre-inst-env inject local paths
Date: Tue, 17 Aug 2021 09:28:30 +0100
[Message part 1 (text/plain, inline)]
On Mon, 16 Aug 2021 20:52:48 +0200
Maxime Devos <maximedevos <at> telenet.be> wrote:

> Sergei Trofimovich schreef op ma 16-08-2021 om 18:28 [+0100]:
> > On Sat, 15 May 2021 10:52:27 +0100
> > Sergei Trofimovich <slyfox <at> gentoo.org> wrote:
> >   
> > > I observed the problem when tried to run 'guix refresh' from local git checkout:
> > > 
> > >     $ 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) = -1 EACCES (Permission denied)
> > > 
> > > Attempt to /usr/share happens because local directory override is ignored:

> The local directory isn't ignored, it's at the end (the effect is about the 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.
> > > 
> > > * gnu/packages/aux-files/guile-launcher.c (main): don't ignore
> > > GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH in GUIX_UNINSTALLED=1 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=1" which goes into libexec, and another
> with "DGUIX_UNINSTALLED=0" named "$CHECKOUT/guile" which isn't installed
> anywhere but will be added to PATH by "pre-inst-env", or something like that?

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 should 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.org/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 #)) (#) …))
   222:29 18 (map1 (((guix records)) ((guix profiles)) ((guix #)) # …))
   222:29 17 (map1 (((guix profiles)) ((guix discovery)) ((guix …)) …))
   222:29 16 (map1 (((guix discovery)) ((guix combinators)) ((# …)) …))
   222:29 15 (map1 (((guix combinators)) ((guix channels)) ((# #)) …))
   222:29 14 (map1 (((guix channels)) ((guix describe)) ((guix #)) …))
   222:29 13 (map1 (((guix describe)) ((guix sets)) ((guix ui)) (#) …))
   222:29 12 (map1 (((guix sets)) ((guix ui)) ((guix diagnostics)) …))
   222:29 11 (map1 (((guix ui)) ((guix diagnostics)) ((guix #)) (#) …))
   222:29 10 (map1 (((guix diagnostics)) ((guix modules)) ((# #)) # …))
   222:29  9 (map1 (((guix modules)) ((guix packages)) ((guix #)) # …))
   222:29  8 (map1 (((guix packages)) ((guix utils)) ((gnu # #)) # …))
   222:29  7 (map1 (((guix utils)) ((gnu packages base)) ((gnu …)) …))
   222:29  6 (map1 (((gnu packages base)) ((gnu packages bash)) (#) …))
   222:29  5 (map1 (((gnu packages bash)) ((gnu packages hurd)) (#) …))
   222:29  4 (map1 (((gnu packages hurd)) ((gnu system setuid)) (#) …))
   222:17  3 (map1 (((gnu system setuid)) ((srfi srfi-1)) ((# #)) # …))
   3329:6  2 (resolve-interface (gnu system setuid) #:select _ #:hide …)
  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!

-- 

  Sergei
[v2-0001-guile-allow-pre-inst-env-inject-local-paths.patch (text/x-patch, attachment)]
[Message part 3 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#48434; Package guix-patches. (Tue, 17 Aug 2021 09:36:01 GMT) Full text and rfc822 format available.

Message #17 received at 48434 <at> debbugs.gnu.org (full text, mbox):

From: Sergei Trofimovich <slyich <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 48434 <at> debbugs.gnu.org
Subject: Re: [bug#48434] [PATCH] guile: allow pre-inst-env inject local paths
Date: Tue, 17 Aug 2021 10:35:39 +0100
[Message part 1 (text/plain, inline)]
On Tue, 17 Aug 2021 09:28:30 +0100
Sergei Trofimovich <slyich <at> gmail.com> wrote:

> On Mon, 16 Aug 2021 20:52:48 +0200
> Maxime Devos <maximedevos <at> telenet.be> wrote:
> 
> > Sergei Trofimovich schreef op ma 16-08-2021 om 18:28 [+0100]:  
> > > On Sat, 15 May 2021 10:52:27 +0100
> > > Sergei Trofimovich <slyfox <at> gentoo.org> wrote:
> > >     
> > > > I observed the problem when tried to run 'guix refresh' from local git checkout:
> > > > 
> > > >     $ 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) = -1 EACCES (Permission denied)
> > > > 
> > > > Attempt to /usr/share happens because local directory override is ignored:  
> 
> > The local directory isn't ignored, it's at the end (the effect is about the 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.
> > > > 
> > > > * gnu/packages/aux-files/guile-launcher.c (main): don't ignore
> > > > GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH in GUIX_UNINSTALLED=1 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=1" which goes into libexec, and another
> > with "DGUIX_UNINSTALLED=0" named "$CHECKOUT/guile" which isn't installed
> > anywhere but will be added to PATH by "pre-inst-env", or something like that?  
> 
> 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 should 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.org/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 #)) (#) …))
>    222:29 18 (map1 (((guix records)) ((guix profiles)) ((guix #)) # …))
>    222:29 17 (map1 (((guix profiles)) ((guix discovery)) ((guix …)) …))
>    222:29 16 (map1 (((guix discovery)) ((guix combinators)) ((# …)) …))
>    222:29 15 (map1 (((guix combinators)) ((guix channels)) ((# #)) …))
>    222:29 14 (map1 (((guix channels)) ((guix describe)) ((guix #)) …))
>    222:29 13 (map1 (((guix describe)) ((guix sets)) ((guix ui)) (#) …))
>    222:29 12 (map1 (((guix sets)) ((guix ui)) ((guix diagnostics)) …))
>    222:29 11 (map1 (((guix ui)) ((guix diagnostics)) ((guix #)) (#) …))
>    222:29 10 (map1 (((guix diagnostics)) ((guix modules)) ((# #)) # …))
>    222:29  9 (map1 (((guix modules)) ((guix packages)) ((guix #)) # …))
>    222:29  8 (map1 (((guix packages)) ((guix utils)) ((gnu # #)) # …))
>    222:29  7 (map1 (((guix utils)) ((gnu packages base)) ((gnu …)) …))
>    222:29  6 (map1 (((gnu packages base)) ((gnu packages bash)) (#) …))
>    222:29  5 (map1 (((gnu packages bash)) ((gnu packages hurd)) (#) …))
>    222:29  4 (map1 (((gnu packages hurd)) ((gnu system setuid)) (#) …))
>    222:17  3 (map1 (((gnu system setuid)) ((srfi srfi-1)) ((# #)) # …))
>    3329:6  2 (resolve-interface (gnu system setuid) #:select _ #:hide …)
>   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)

With https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50090 applied 'guix pull'
works successfully on a multi-user foreign distribution.

-- 

  Sergei
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#48434; Package guix-patches. (Tue, 17 Aug 2021 10:26:02 GMT) Full text and rfc822 format available.

Message #20 received at 48434 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Sergei Trofimovich <slyich <at> gmail.com>
Cc: 48434 <at> debbugs.gnu.org
Subject: Re: [bug#48434] [PATCH] guile: allow pre-inst-env inject local paths
Date: Tue, 17 Aug 2021 12:24:50 +0200
[Message part 1 (text/plain, inline)]
Sergei Trofimovich schreef op di 17-08-2021 om 09:28 [+0100]:
> 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.org/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

I meant something like "$ guix pull --url=. --commit=... --root=guix0"
or "$ ./pre-inst-env guix pull --url=. --commit=... --root=guix1" or
"$ ./pre-inst-env guix pull --root=guix2".  Simply running "$
guix pull",
outside "./pre-inst-env", would simply test the (unpatched) guix you have
installed (with "make install" or "apt-get install guix" or "guix pull"),
and doesn't test the patched guix.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#48434; Package guix-patches. (Tue, 17 Aug 2021 12:17:02 GMT) Full text and rfc822 format available.

Message #23 received at 48434 <at> debbugs.gnu.org (full text, mbox):

From: Sergei Trofimovich <slyich <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 48434 <at> debbugs.gnu.org
Subject: Re: [bug#48434] [PATCH] guile: allow pre-inst-env inject local paths
Date: Tue, 17 Aug 2021 13:15:51 +0100
[Message part 1 (text/plain, inline)]
On Tue, 17 Aug 2021 12:24:50 +0200
Maxime Devos <maximedevos <at> telenet.be> wrote:

> Sergei Trofimovich schreef op di 17-08-2021 om 09:28 [+0100]:
> > 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.org/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  
> 
> I meant something like "$ guix pull --url=. --commit=... --root=guix0"
> or "$ ./pre-inst-env guix pull --url=. --commit=... --root=guix1" or
> "$ ./pre-inst-env guix pull --root=guix2".  Simply running "$
> guix pull",
> outside "./pre-inst-env", would simply test the (unpatched) guix you have
> installed (with "make install" or "apt-get install guix" or "guix pull"),
> and doesn't test the patched guix.

Ah. I did install patched guix into the system (and that's how
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50090).

I still don't quite understand if channel we pull from also should be patched.
Let's assume it should:

  $ LANG=C ./pre-inst-env guix pull --url=. --commit=e9029ed5eae45ee8f53f055ee66f9bce353cac84 --root=guix0
  guix pull: error: root=guix0: unrecognized option

I'm not sure what --root= does. Is it a user name? Or a profile name?

-- 

  Sergei
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#48434; Package guix-patches. (Tue, 17 Aug 2021 14:00:02 GMT) Full text and rfc822 format available.

Message #26 received at 48434 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Sergei Trofimovich <slyich <at> gmail.com>
Cc: 48434 <at> debbugs.gnu.org
Subject: Re: [bug#48434] [PATCH] guile: allow pre-inst-env inject local paths
Date: Tue, 17 Aug 2021 15:59:05 +0200
[Message part 1 (text/plain, inline)]
> Ah. I did install patched guix into the system (and that's how
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50090).
> 
> I still don't quite understand if channel we pull from also should be patched.
> Let's assume it should:
> 
>   $ LANG=C ./pre-inst-env guix pull --url=. --commit=e9029ed5eae45ee8f53f055ee66f9bce353cac84 --root=guix0
>   guix pull: error: root=guix0: unrecognized option
> 
> I'm not sure what --root= does. Is it a user name? Or a profile name?

I forgot the exact option, it should have been "--profile=guix0".
From (guix)Submitting patches:

  15. Make sure your changes do not break Guix and simulate a ‘guix
     pull’ with:
          guix pull --url=/path/to/your/checkout --profile=/tmp/guix.master

Greetings,
Maxime.

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#48434; Package guix-patches. (Tue, 17 Aug 2021 17:43:02 GMT) Full text and rfc822 format available.

Message #29 received at 48434 <at> debbugs.gnu.org (full text, mbox):

From: Sergei Trofimovich <slyich <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 48434 <at> debbugs.gnu.org
Subject: Re: [bug#48434] [PATCH] guile: allow pre-inst-env inject local paths
Date: Tue, 17 Aug 2021 18:42:05 +0100
[Message part 1 (text/plain, inline)]
On Tue, 17 Aug 2021 15:59:05 +0200
Maxime Devos <maximedevos <at> telenet.be> wrote:

> > Ah. I did install patched guix into the system (and that's how
> > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50090).
> > 
> > I still don't quite understand if channel we pull from also should be patched.
> > Let's assume it should:
> > 
> >   $ LANG=C ./pre-inst-env guix pull --url=. --commit=e9029ed5eae45ee8f53f055ee66f9bce353cac84 --root=guix0
> >   guix pull: error: root=guix0: unrecognized option
> > 
> > I'm not sure what --root= does. Is it a user name? Or a profile name?  
> 
> I forgot the exact option, it should have been "--profile=guix0".
> From (guix)Submitting patches:
> 
>   15. Make sure your changes do not break Guix and simulate a ‘guix
>      pull’ with:
>           guix pull --url=/path/to/your/checkout --profile=/tmp/guix.master
> 

Aha, thank you! That works:

$                guix pull --commit=... --url=${PWD} --profile=/tmp/g1.master --disable-authentication
$ ./pre-inst-env guix pull --commit=... --url=${PWD} --profile=/tmp/g2.master --disable-authentication

-- 

  Sergei
[Message part 2 (application/pgp-signature, inline)]

This bug report was last modified 3 years and 299 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.