‘guix_ search’ traverses all the modules when extra channels are used

OpenSubmitted by Ludovic Courtès.
Details
3 participants
  • Ludovic Courtès
  • Ludovic Courtès
  • zimoun
Owner
unassigned
Severity
important
L
L
Ludovic Courtès wrote on 11 Dec 2020 10:29
‘guix search’ traverses all the modules when extra channels are used
(address . bug-guix@gnu.org)
87ft4c8zcp.fsf@inria.fr
When a single channel is in use, ‘guix search’ understandable traversesnothing but gnu/packages/*.scm:
Toggle snippet (6 lines)$ strace -o /tmp/,,s guix search sdfsdf$ grep gnu/services /tmp/,,s$ echo $?1
But with multiple channels, all of the guile-module-union directory istraversed, and that includes *everything*:
Toggle snippet (32 lines)$ /tmp/past/bin/guix describeGeneracio 1 Dec 11 2020 10:26:58 (nuna) guix-past 829923f repository URL: https://gitlab.inria.fr/guix-hpc/guix-past branch: master commit: 829923f01f894f1e687735627025ada26230832f guix f765577 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: f765577dec0340d035021d030f17b54a3a5fd6b1$ strace -o /tmp/,,s /tmp/past/bin/guix search sdfsdf$ grep gnu/services /tmp/,,sstat("/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/share/guile/site/3.0/gnu/services.scm", {st_mode=S_IFREG|0444, st_size=41045, ...}) = 0stat("/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/lib/guile/3.0/site-ccache/gnu/services.go", {st_mode=S_IFREG|0444, st_size=420021, ...}) = 0openat(AT_FDCWD, "/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/lib/guile/3.0/site-ccache/gnu/services.go", O_RDONLY|O_CLOEXEC) = 14stat("/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/share/guile/site/3.0/gnu/services/shepherd.scm", {st_mode=S_IFREG|0444, st_size=23156, ...}) = 0stat("/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/lib/guile/3.0/site-ccache/gnu/services/shepherd.go", {st_mode=S_IFREG|0444, st_size=405997, ...}) = 0openat(AT_FDCWD, "/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/lib/guile/3.0/site-ccache/gnu/services/shepherd.go", O_RDONLY|O_CLOEXEC) = 14stat("/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/share/guile/site/3.0/gnu/services/herd.scm", {st_mode=S_IFREG|0444, st_size=10387, ...}) = 0stat("/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/lib/guile/3.0/site-ccache/gnu/services/herd.go", {st_mode=S_IFREG|0444, st_size=188509, ...}) = 0openat(AT_FDCWD, "/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/lib/guile/3.0/site-ccache/gnu/services/herd.go", O_RDONLY|O_CLOEXEC) = 14stat("/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/share/guile/site/3.0/gnu/services/base.scm", {st_mode=S_IFREG|0444, st_size=110305, ...}) = 0stat("/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/lib/guile/3.0/site-ccache/gnu/services/base.go", {st_mode=S_IFREG|0444, st_size=2203613, ...}) = 0openat(AT_FDCWD, "/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/lib/guile/3.0/site-ccache/gnu/services/base.go", O_RDONLY|O_CLOEXEC) = 14stat("/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/share/guile/site/3.0/gnu/services/admin.scm", {st_mode=S_IFREG|0444, st_size=12494, ...}) = 0stat("/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/lib/guile/3.0/site-ccache/gnu/services/admin.go", {st_mode=S_IFREG|0444, st_size=416133, ...}) = 0openat(AT_FDCWD, "/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/lib/guile/3.0/site-ccache/gnu/services/admin.go", O_RDONLY|O_CLOEXEC) = 14stat("/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/share/guile/site/3.0/gnu/services/mcron.scm", {st_mode=S_IFREG|0444, st_size=7667, ...}) = 0stat("/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/lib/guile/3.0/site-ccache/gnu/services/mcron.go", {st_mode=S_IFREG|0444, st_size=187549, ...}) = 0openat(AT_FDCWD, "/gnu/store/3jnlvi2akawnxd1jq6m58kxc7nj07phc-guix-module-union/lib/guile/3.0/site-ccache/gnu/services/mcron.go", O_RDONLY|O_CLOEXEC) = 14
This was reported by bdju on #guix, who were getting the new SSHpassword warning while running ‘guix search’.
Ludo’.
Z
Z
zimoun wrote on 11 Dec 2020 13:45
86blf0h5pv.fsf@gmail.com
Hi Ludo,
On Fri, 11 Dec 2020 at 10:29, Ludovic Courtès <ludovic.courtes@inria.fr> wrote:
Toggle quote (7 lines)> --8<---------------cut here---------------start------------->8---> $ strace -o /tmp/,,s guix search sdfsdf> $ grep gnu/services /tmp/,,s> $ echo $?> 1> --8<---------------cut here---------------end--------------->8---
I do not know what is the point of the strace command, but this filecontains a lot:
Toggle snippet (19 lines)$ guix describeGeneration 50 Dec 01 2020 23:31:01 (current) guix f4450e8 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: f4450e8ca909530ee3432710b82f97e23acc7fef$ strace -o /tmp/,,s guix search sdfsdf $ cat /tmp/,,s | grep ice-9 | wc -l448$ cat /tmp/,,s | grep srfi | wc -l330$ cat /tmp/,,s | grep 'guix/build' | wc -l129$ cat /tmp/,,s | grep 'guix/scripts' | wc -l12$cat /tmp/,,s | grep 'guix/import' | wc -l9
But no ’services’, indeed. The 3 first are expected since they usedsomehow by files in ’gnu/packages/’. I am surprised by ’guix/scripts’or ’guix/import’, the few I tried.

And I note a variation with the option ’-L’.
Toggle snippet (12 lines)$ mkdir -p /tmp/foo$ ls /tmp/foo/$ strace -o /tmp/,,l guix search sdfsdf -L /tmp/foo$ wc -l /tmp/,,l /tmp/,,s 10059 /tmp/,,l 8745 /tmp/,,s 18804 total$ grep services /tmp/,,l$ echo $?1
Well, I am not sure to understand… And last, the bug:
Toggle snippet (11 lines)$ strace -o /tmp/,,g guix search sdfsdf -L ~/src/guix/guix-past/modules$ cat /tmp/,,g | grep 'gnu/services' | wc -l30$ ag services ~/src/guix/guix-past/$ echo $?1$ ls -1 ~/src/guix/guix/gnu/services/*.scm | wc -l50

All the best,simon
L
L
Ludovic Courtès wrote on 11 Dec 2020 15:15
control message for bug #45173
(address . control@debbugs.gnu.org)
87k0to77jt.fsf@gnu.org
severity 45173 importantquit
L
L
Ludovic Courtès wrote on 11 Dec 2020 16:56
Re: bug#45173: ‘guix search’ traverses all the modules when extra channels are used
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 45173@debbugs.gnu.org)
875z5872vv.fsf@inria.fr
Hi!
zimoun <zimon.toutoune@gmail.com> skribis:
Toggle quote (12 lines)> On Fri, 11 Dec 2020 at 10:29, Ludovic Courtès <ludovic.courtes@inria.fr> wrote:>>> --8<---------------cut here---------------start------------->8--->> $ strace -o /tmp/,,s guix search sdfsdf>> $ grep gnu/services /tmp/,,s>> $ echo $?>> 1>> --8<---------------cut here---------------end--------------->8--->> I do not know what is the point of the strace command, but this file> contains a lot:
The point :-) is to show that things that should definitely not beloaded, such as gnu/services/*, are getting loaded when multiplechannels are in use.
Ludo’.
Z
Z
zimoun wrote on 11 Dec 2020 17:44
(name . Ludovic Courtès)(address . ludovic.courtes@inria.fr)(address . 45173@debbugs.gnu.org)
86zh2kfg2r.fsf@gmail.com
Hey,
On Fri, 11 Dec 2020 at 16:56, Ludovic Courtès <ludovic.courtes@inria.fr> wrote:
Toggle quote (4 lines)> The point :-) is to show that things that should definitely not be> loaded, such as gnu/services/*, are getting loaded when multiple> channels are in use.
What I have tried to show is that even with the default, «things thatshould definitely not be loaded, such as guix/scripts/* orguix/import/*» are getting loaded. And worse, adding an empty“--load-path” adds burden. Multiple channels seems only one part of thestory. :-)
Cheers,simon
?