Subject: ‘%load-path’ in shepherd is unnecessarily long
From: Ludovic Courtès <[email-masked]>
To: [email-masked]
Date: Fri, 27 Sep 2019 09:22:07 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello Guix!

Here’s what I get on my freshly booted system:

--8<---------------cut here---------------start------------->8---
$ sudo herd eval root %load-path
Evaluating user expression %load-path.
("/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/8a49xjf71dxzj2j4vqh4gw840xv1shxg-module-import" "/gnu/store/8a49xjf71dxzj2j4vqh4gw840xv1shxg-module-import" "/gnu/store/8a49xjf71dxzj2j4vqh4gw840xv1shxg-module-import" "/gnu/store/8a49xjf71dxzj2j4vqh4gw840xv1shxg-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/8a49xjf71dxzj2j4vqh4gw840xv1shxg-module-import" "/gnu/store/8a49xjf71dxzj2j4vqh4gw840xv1shxg-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/2dqkjgfd15yf3s62g001xkxgycadh7fm-module-import" "/gnu/store/2dqkjgfd15yf3s62g001xkxgycadh7fm-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/ldzgghnf4gm3y4367sknlig3wz3gvg7a-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/jrfjb1rd5jxi8fnz1ycsi55r4i7mpwr6-module-import" "/gnu/store/f4w6qzgsnxsm2cq8mn8fwnj5d5lirkad-shepherd-0.6.1/share/guile/site/2.2" "/gnu/store/1mkkv2caiqbdbbd256c4dirfi4kwsacv-guile-2.2.6/share/guile/2.2" "/gnu/store/1mkkv2caiqbdbbd256c4dirfi4kwsacv-guile-2.2.6/share/guile/site/2.2" "/gnu/store/1mkkv2caiqbdbbd256c4dirfi4kwsacv-guile-2.2.6/share/guile/site" "/gnu/store/1mkkv2caiqbdbbd256c4dirfi4kwsacv-guile-2.2.6/share/guile")
$ sudo herd eval root '(length %load-path)'
Evaluating user expression (length %load-path).
119
--8<---------------cut here---------------end--------------->8---

As you can see, this is not great.

This comes from the load-path expression in shepherd-*.scm:

--8<---------------cut here---------------start------------->8---
(eval-when
    (expand load eval)
  (set! %load-path
    (cons "/gnu/store/8a49xjf71dxzj2j4vqh4gw840xv1shxg-module-import"
	  (append
	   (map
	    (lambda
		(extension)
	      (string-append extension "/share/guile/site/"
			     (effective-version)))
	    (quote
	     ()))
	   %load-path)))
  (set! %load-compiled-path
    (cons "/gnu/store/lfj61bg7bb0aypqwj47j2dqnwc9bvpiw-module-import-compiled"
	  (append
	   (map
	    (lambda
		(extension)
	      (string-append extension "/lib/guile/"
			     (effective-version)
			     "/site-ccache"))
	    (quote
	     ()))
	   %load-compiled-path))))
--8<---------------cut here---------------end--------------->8---

Problem is that every time you reconfigure, the load path grows.  Seen
on an important machine (ahem…):

--8<---------------cut here---------------start------------->8---
# herd eval root '(length %load-path)'
Evaluating user expression (length %load-path).
2508
--8<---------------cut here---------------end--------------->8---

Ludo’.