Subject: bug#42810: Guix doesn't follow all symlinks

From: zimoun <[email-masked]>
Date: Wed, 16 Sep 2020 01:02:53 +0200

Dear,

On Tue, 11 Aug 2020 at 15:54, Steffen Rytter Postas <[email-masked]> wrote:
> Hi,
>
> Some background first, to better understand the issue:
> I've been running Guix on a foreign distribution
> with my own channel in ~/.config/guix/channels.scm for some time now. 
> However this means having to deal with doing both a `guix pull` as
>  a user, but also `guix pull` as superuser to keep the system
> builder daemon etc up to date.
> I wanted to avoid this, by using simply a system-wide guix install, and
> not have my own user have a guix variant. I tried simply deleting
> ~/.config/guix/current symlink, and confirmed that `guix` was now using
> the `/usr/local/bin/guix` symlink.
> Then I moved my ~/.config/guix/channels.scm file to
> /etc/guix/channels.scm
> and satisfied with my setup, performed `sudo guix pull --fallback` to
> pull the latest changes and verify it worked.
> The command ran as expected, and printed the new packages from my
> channel that were now available.

Well, I am not sure to understand why you want this setup since
“guix-daemon” needs (really) few updates and as regular user, when doing
“guix pull”, if there is major upgrade, then it will be announced with
“guix pull –news”.  We all like different tastes. :-)

> `type guix`:
> /usr/local/bin/guix
>
> `readlink /usr/local/bin/guix`
> /var/guix/profiles/per-user/root/current-guix/bin/guix
>
> `/usr/local/bin/guix show entr-git`
> guix show: error: entr-git: package not found
>
> `/var/guix/profiles/per-user/root/current-guix/bin/guix show entr-git`
> name: entr-git
> version: 4.5-0.6b13a97

[...]

So, if I understand correctly, as a regular user, the command ’guix’
points to ’/usr/local/bin/guix’ which points to
’/var/guix/profiles/per-user/root/current-guix/bin/guix’, and this
latter points to ’/gnu/store/…-guix-command’.

I think the issue is that Guix is not only one binary, so ’bin/guix’ is
not enough.

So you need to have also in the correct symlinks with ’lib/{guile,guix}’
and others.

I have not investigated but I guess the issue you hit comes from
’lib/guix/package.cache’, correctly see by
/var/guix/profiles/…/bin/guix’ but not all your other symlink machinery.

Well, I do not know if it helps.

All the best,
simon