GNU bug report logs - #77487
1.4 million extraneous symlinks under .guix-home/profile/share/icons

Previous Next

Package: guix;

Reported by: "Timo Wilken" <guix <at> twilken.net>

Date: Thu, 3 Apr 2025 12:07:01 UTC

Severity: normal

Found in version 1.4

Done: 宋文武 <iyzsong <at> envs.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77487 in the body.
You can then email your comments to 77487 AT debbugs.gnu.org in the normal way.

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

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


Report forwarded to bug-guix <at> gnu.org:
bug#77487; Package guix. (Thu, 03 Apr 2025 12:07:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Timo Wilken" <guix <at> twilken.net>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 03 Apr 2025 12:07:02 GMT) Full text and rfc822 format available.

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

From: "Timo Wilken" <guix <at> twilken.net>
To: <bug-guix <at> gnu.org>
Subject: 1.4 million extraneous symlinks under .guix-home/profile/share/icons
Date: Thu, 03 Apr 2025 14:05:40 +0200
Hi,

In my ~/.guix-home/profile/share/icons/, I have a total of 1.4 million
symlinks:

$ find ~/.guix-home/profile/share/icons/ -type l -printf x | wc -c
1425657

The directory itself is not a symlink. Instead, it contains the following
structure (with the papirus-icon-theme package installed):

~/.guix-home/profile/share/icons/
  + Papirus/
    + icon-theme.cache -> /gnu/store/...-gtk-icon-themes/share/icons/Papirus/icon-theme.cache
    + index.theme -> /gnu/store/...-gtk-icon-themes/share/icons/Papirus/index.theme
    + 16x16/
      + apps/
        + 010editor.svg -> /gnu/store/...-gtk-icon-themes/share/icons/Papirus/16x16/apps/010editor.svg
        + 09BE_EpicGamesLauncher.0.svg -> /gnu/store/...-gtk-icon-themes/share/icons/Papirus/16x16/apps/09BE_EpicGamesLauncher.0.svg
        + 0ad.svg -> /gnu/store/...-gtk-icon-themes/share/icons/Papirus/16x16/apps/0ad.svg
        [and so on, and so forth...]

I.e., every single image file in every single icon theme is linked
individually -- none of the 16x16 (etc) directories are symlinks!

These files are also all symlinks to
/gnu/store/...-gtk-icon-themes/share/icons/<icon>, where <icon> is their own
filename under ~/.guix-homme/profile/share/icons/. There are no symlinks that
point anywhere else -- even the icon-theme.cache and index.theme symlinks
point into the same "gtk-icon-themes" union.

I've checked this using the following shell snippet:

$ cd ~/.guix-home/profile/share/icons
$ find */ -type l -printf '%p\t%l\n' | awk -F'\t' '{
    gsub(/[^a-zA-Z0-9/_-]/, "[&]", $1)   # escape symlink path as regex
    sub("/" $1 "$", "", $2)   # remove symlink path from the end of its target path
    print $2                  # print trimmed target path
}' | uniq -c
1433393 /gnu/store/zg7wwydwjaykpp0dwzq97hzilzd3q85f-gtk-icon-themes/share/icons

My question is therefore: why isn't ~/.guix-home/profile/share/icons itself a
symlink to /gnu/store/...-gtk-icon-themes/share/icons? That would get my home
profile down from 1,440,513 to a measly 14,857 symlinks in total -- and
presumably speed up the home profile creation by a lot (instead of taking over
a minute on a fast NVME SSD)!

I've tried digging into (guix build union) and (guix profiles), but I've not
found anything obviously wrong...

Cheers,
Timo




Information forwarded to bug-guix <at> gnu.org:
bug#77487; Package guix. (Sat, 05 Apr 2025 17:28:01 GMT) Full text and rfc822 format available.

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

From: Leo Famulari <leo <at> famulari.name>
To: Timo Wilken <guix <at> twilken.net>
Cc: 77487 <at> debbugs.gnu.org
Subject: Re: bug#77487: 1.4 million extraneous symlinks under
 .guix-home/profile/share/icons
Date: Sat, 5 Apr 2025 13:27:35 -0400
On Thu, Apr 03, 2025 at 02:05:40PM +0200, Timo Wilken wrote:
> 
> In my ~/.guix-home/profile/share/icons/, I have a total of 1.4 million
> symlinks:
> 
> $ find ~/.guix-home/profile/share/icons/ -type l -printf x | wc -c
> 1425657

Oof.

I have nothing like that with Guix itself (compared to Guix Home), but
it's still a lot:

$ find ~/.guix-profile/share/icons/ -type l -printf x | wc -c 
77714




Information forwarded to bug-guix <at> gnu.org:
bug#77487; Package guix. (Mon, 14 Apr 2025 16:50:02 GMT) Full text and rfc822 format available.

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

From: "Timo Wilken" <guix <at> twilken.net>
To: "Leo Famulari" <leo <at> famulari.name>, <77487 <at> debbugs.gnu.org>
Subject: Re: bug#77487: 1.4 million extraneous symlinks under
 .guix-home/profile/share/icons
Date: Mon, 14 Apr 2025 18:49:04 +0200
Hi Leo, hi Guix,

On Sat 5 Apr 2025 at 7:27 pm CEST, Leo Famulari wrote:
> I have nothing like that with Guix itself (compared to Guix Home), but
> it's still a lot:
>
> $ find ~/.guix-profile/share/icons/ -type l -printf x | wc -c 
> 77714

Thanks for confirming it's not just me! :)

I've created a minimal reproducer of the problem at the guix repl:

--8<---------------cut here--------------->8--
$ guix repl
scheme@(guix-user)> ,use (gnu packages gtk)        ; for `gtk+'
scheme@(guix-user)> ,use (gnu packages gnome-xyz)  ; for `papirus-icon-theme'
scheme@(guix-user)> ,use (guix build union)
scheme@(guix-user)> ,use (guix profiles)
scheme@(guix-user)> ,use (guix monad-repl)
scheme@(guix-user)> (define gtk-icon-themes (@@ (guix profiles) gtk-icon-themes))
scheme@(guix-user)> ,run-in-store (gtk-icon-themes (packages->manifest (list papirus-icon-theme gtk+)))
$1 = #<derivation /gnu/store/26mhjywzy2k9317r6919d84mnchmh3di-gtk-icon-themes.drv => /gnu/store/b0jpr69mrczigdz0p0dy1mlnqgwanxf7-gtk-icon-themes 7f3d000cc820>
scheme@(guix-user)> ,build $1
$2 = "/gnu/store/b0jpr69mrczigdz0p0dy1mlnqgwanxf7-gtk-icon-themes"
scheme@(guix-user)> ,build papirus-icon-theme
$3 = "/gnu/store/s69hs11nn6bxi32by6ab1qaq36kgpvva-papirus-icon-theme-20250201"
scheme@(guix-user)> (define tmpdir (string-append (mkdtemp "/tmp/guix-profile-XXXXXX") "/profile"))
scheme@(guix-user)> ,run-in-store (union-build tmpdir (list $2 $3))
--8<---------------cut here--------------->8--

Warning: loads and loads of output -- one line for every one of the 1.4
million symlinks created!

You can also inspect the tree /tmp/guix-profile-*/profile/share/icons to see
that indeed, each icon file is symlinked individually.

If I build a union that does not include both the icon theme and the result of
the `gtk-icon-themes' hook, such as the following:

--8<---------------cut here--------------->8--
scheme@(guix-user)> ,build gtk+
$4 = "/gnu/store/w70sdx3n5bhancx10x1jfphq5v8943is-gtk+-3.24.43-bin"
$5 = "/gnu/store/4qrbd85gy5j38fj9prk8w31zchlxh3k1-gtk+-3.24.43"
scheme@(guix-user)> (define tmpdir (string-append (mkdtemp "/tmp/guix-profile-XXXXXX") "/profile"))
scheme@(guix-user)> ,run-in-store (union-build tmpdir (list $2 $5))
--8<---------------cut here--------------->8--

...then the icon themes are linked correctly in that profile, i.e. a single
symlink per theme under /tmp/guix-profile-*/profile/share/icons/.

Therefore, the problem must be including both the icon theme packages and the
result of the `gtk-icon-themes' hook in the same profile.

Would it make sense for Guix to remove the icon theme packages from the
profile before trying to build the final union? The icons should still be
linked through the result of `gtk-icon-themes'.

Cheers,
Timo




Information forwarded to bug-guix <at> gnu.org:
bug#77487; Package guix. (Thu, 17 Apr 2025 05:05:02 GMT) Full text and rfc822 format available.

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

From: Evan Cooney <evancooney71 <at> gmail.com>
To: 77487 <at> debbugs.gnu.org
Subject: A patch that fixes this!
Date: Wed, 16 Apr 2025 20:19:19 -0500
I had this same issue! I worked with Rutherer to fix this issue and he 
submitted a patch! Here it is: https://issues.guix.gnu.org/77251


Thanks for reporting,

Evan Cooney





Reply sent to 宋文武 <iyzsong <at> envs.net>:
You have taken responsibility. (Sun, 27 Apr 2025 02:36:03 GMT) Full text and rfc822 format available.

Notification sent to "Timo Wilken" <guix <at> twilken.net>:
bug acknowledged by developer. (Sun, 27 Apr 2025 02:36:03 GMT) Full text and rfc822 format available.

Message #19 received at 77487-done <at> debbugs.gnu.org (full text, mbox):

From: 宋文武 <iyzsong <at> envs.net>
To: Rutherther <rutherther <at> ditigal.xyz>
Cc: 77487-done <at> debbugs.gnu.org, 77251-done <at> debbugs.gnu.org
Subject: Re: [bug#77251] [PATCH] guix: gtk-icon-themes: produce only cache
 in output
Date: Sun, 27 Apr 2025 10:40:22 +0800
Rutherther <rutherther <at> ditigal.xyz> writes:

> This patch changes the behavior of gtk-icon-themes to produce only the
> icon-theme.cache cache files, instead of producing the whole union.
> The reason for this is that by producing the whole union, the icons are put to
> the profile twice. This throws off the union build of the profile and symlinks
> all the individual files instead of symlinking folders. This means
> unnecessarily high numbers of symlinks are produced.
>
> * guix/profiles.scm (gtk-icon-themes): Produce only caches

Pushed to master as commit 32575294, with simplified commit message.

Thank you!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 25 May 2025 11:24:25 GMT) Full text and rfc822 format available.

This bug report was last modified 20 days ago.

Previous Next


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