Guix doesn't follow all symlinks

OpenSubmitted by Steffen Rytter Postas.
Details
2 participants
  • Steffen Rytter Postas
  • zimoun
Owner
unassigned
Severity
normal
S
S
Steffen Rytter Postas wrote on 11 Aug 2020 15:54
(address . bug-guix@gnu.org)
aaed7092134ff6007f4c05fb39a88f4939cc2cbc.camel@scalehost.eu
Hi,
Some background first, to better understand the issue:I've been running Guix on a foreign distributionwith 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 systembuilder daemon etc up to date.I wanted to avoid this, by using simply a system-wide guix install, andnot have my own user have a guix variant. I tried simply deleting~/.config/guix/current symlink, and confirmed that `guix` was now usingthe `/usr/local/bin/guix` symlink.Then I moved my ~/.config/guix/channels.scm file to/etc/guix/channels.scmand satisfied with my setup, performed `sudo guix pull --fallback` topull the latest changes and verify it worked.The command ran as expected, and printed the new packages from mychannel that were now available.
So, that's the background of what I've been trying to do. Here's whathappened:
I have in my own channel a package called `entr-git`. Installing it issimple:
`guix show entr-git`
Expected result:
name: entr-gitversion: 4.5-0.6b13a97outputs: outsystems: x86_64-linux i686-linuxdependencies: ncurses@6.2location: gnu/packages/entr-git.scm:25:2homepage: http://entrproject.org/license: ISCsynopsis: Run arbitrary commands when files change description: entr is a zero-configuration tool with no external buildor run-time dependencies. The interface to entr is not only minimal,it aims to be simple enough to create a new+ category of ad hoc automation. These micro-tests reduce keystrokes,but more importantly they emphasize the utility of automated checks.
Actual result:
guix show: error: entr-git: package not found
Additional information:
`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-gitversion: 4.5-0.6b13a97outputs: outsystems: x86_64-linux i686-linuxdependencies: ncurses@6.2location: gnu/packages/entr-git.scm:25:2homepage: http://entrproject.org/license: ISCsynopsis: Run arbitrary commands when files change description: entr is a zero-configuration tool with no external buildor run-time dependencies. The interface to entr is not only minimal,it aims to be simple enough to create a new+ category of ad hoc automation. These micro-tests reduce keystrokes,but more importantly they emphasize the utility of automated checks.
Simplest reproduction of issue:
* Ubuntu 20.04 AMD64 Desktop/Server system.* Install Guix using guix-install.sh script.* As a user, ensure absence of ~/.config/guix/current symlink.* As a user, run `guix pull --fallback`* As a user, run `guix describe`.* As a user, run `sudo guix describe`.* As root, run `guix describe`.
Workaround:
Use `/var/guix/profiles/per-user/root/current-guix/bin/guix` "directly"(despite this also being a symlink).

I hope this is enough relevant information, otherwise it appears verystraight forward to reproduce.
Sincerely,Steffen Rytter Postas
Z
Z
zimoun wrote on 16 Sep 2020 01:02
(name . Steffen Rytter Postas)(address . nc@scalehost.eu)(address . 42810@debbugs.gnu.org)
867dsuzlr6.fsf@gmail.com
Dear,
On Tue, 11 Aug 2020 at 15:54, Steffen Rytter Postas <nc@scalehost.eu> wrote:
Toggle quote (19 lines)> 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. :-)

Toggle quote (13 lines)> `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 thislatter points to ’/gnu/store/…-guix-command’.
I think the issue is that Guix is not only one binary, so ’bin/guix’ isnot 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
S
S
Steffen Rytter Postas wrote on 16 Sep 2020 08:45
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 42810@debbugs.gnu.org)
ab263d28d5cff211b3e7ac5217bf7e9f417d0938.camel@scalehost.eu
Hi,
ons, 16 09 2020 kl. 01:02 +0200, skrev zimoun:
Toggle quote (34 lines)> Dear,> > On Tue, 11 Aug 2020 at 15:54, Steffen Rytter Postas <nc@scalehost.eu>> 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. :-)
I also wanted to maintain only one copy of "guix" usable, instead ofhaving one version of guix per user, which is a lot harder to maintain.
Toggle quote (29 lines)> > `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.
How would I set this up? This happens on a default Guix setup followingthe standard installation guide for installing on a foreigndistribution, and then setting up the channel configuration asmentioned.
Toggle quote (7 lines)> > 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.>
This does make sense, if that is somehow only read from a non-storelocation (I'm not sure why it would be, that seems against all thepoint of guix in the first place).
Toggle quote (8 lines)> > Well, I do not know if it helps.> > All the best,> simon> > >
Z
Z
zimoun wrote on 16 Sep 2020 09:26
(name . Steffen Rytter Postas)(address . nc@scalehost.eu)(address . 42810@debbugs.gnu.org)
CAJ3okZ0pn9TzmsM7w7fNWiU=VcZ1ZkR8Q2yzFQb4=aswdi2EgQ@mail.gmail.com
Dear,
On Wed, 16 Sep 2020 at 08:45, Steffen Rytter Postas <nc@scalehost.eu> wrote:
Toggle quote (10 lines)> > 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. :-)>> I also wanted to maintain only one copy of "guix" usable, instead of> having one version of guix per user, which is a lot harder to maintain.
But the point of Guix is: each user manages their own version, isn't it?From my point of view, it does not make sense to try to maintain onlyone central copy, because in any case, each user can run:
guix time-machine -C <channels.scm> -- <command> guix time-machine --commit=<hash> -- <command>
so each user can install, remove, etc. any version of Guix (specifiedby <channels.scm> and <hash>) independently of the version of "guixtime-machine".
Well, I am not sure to understand the aim of the configuration you want to.

Toggle quote (9 lines)> > So you need to have also in the correct symlinks with> > ’lib/{guile,guix}’> > and others.>> How would I set this up? This happens on a default Guix setup following> the standard installation guide for installing on a foreign> distribution, and then setting up the channel configuration as> mentioned.
I do not know how you could setup your non-standard usage of Guix.
Maybe you could try as root:
sudo guix pull -p /usr
then place /usr in the correct paths (PATH, LIBRARY_PATH, etc.) foreach user. However, it will be easy for one user to by-pass yoursetup and use any version of Guix they wants:
/usr/bin/guix pull -p /path/somewhere/to/user-home
then the user can correctly set up the paths so that "guix" will referto the one living at /path/somewhere/to/user-home/.
Well, from my understanding, you are trying to set up Guix in theparadigm of classic package manager, not in its "philosophy".

Toggle quote (10 lines)> > 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.> >>> This does make sense, if that is somehow only read from a non-store> location (I'm not sure why it would be, that seems against all the> point of guix in the first place).
I am not sure to understand what you mean.

Do the explanations help?
All the best,simon
S
S
Steffen Rytter Postas wrote on 16 Sep 2020 09:35
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 42810@debbugs.gnu.org)
634882b61652f958e44760e64179bcdc99481310.camel@scalehost.eu
Hi,
ons, 16 09 2020 kl. 09:26 +0200, skrev zimoun:
Toggle quote (34 lines)> Dear,> > On Wed, 16 Sep 2020 at 08:45, Steffen Rytter Postas <nc@scalehost.eu>> wrote:> > > > 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. :-)> > > > I also wanted to maintain only one copy of "guix" usable, instead> > of> > having one version of guix per user, which is a lot harder to> > maintain.> > But the point of Guix is: each user manages their own version, isn't> it?> From my point of view, it does not make sense to try to maintain only> one central copy, because in any case, each user can run:> > guix time-machine -C <channels.scm> -- <command>> guix time-machine --commit=<hash> -- <command>> > so each user can install, remove, etc. any version of Guix (specified> by <channels.scm> and <hash>) independently of the version of "guix> time-machine".> > Well, I am not sure to understand the aim of the configuration you> want to.>
This may well be the point of Guix, and maybe I'm' following too muchof a classical paradigm, but for me on a classical Linux desktopsystem, it is much easier for me to just use _one_ version of Guix,regardless of using it as my own user, or installing applications asroot.
I'm not sure why this should _not_ work. What is the arguments againstmy use case? Is it that each user _MUST_ run `guix pull` as their ownuser and _NEVER_ use the system-wide Guix with local channels?
Toggle quote (31 lines)> > > > So you need to have also in the correct symlinks with> > > ’lib/{guile,guix}’> > > and others.> > > > How would I set this up? This happens on a default Guix setup> > following> > the standard installation guide for installing on a foreign> > distribution, and then setting up the channel configuration as> > mentioned.> > I do not know how you could setup your non-standard usage of Guix.> > Maybe you could try as root:> > sudo guix pull -p /usr> > then place /usr in the correct paths (PATH, LIBRARY_PATH, etc.) for> each user. However, it will be easy for one user to by-pass your> setup and use any version of Guix they wants:> > /usr/bin/guix pull -p /path/somewhere/to/user-home> > then the user can correctly set up the paths so that "guix" will> refer> to the one living at /path/somewhere/to/user-home/.> > Well, from my understanding, you are trying to set up Guix in the> paradigm of classic package manager, not in its "philosophy".>
I do not mind being able to by-pass any setup I've made. This is for myown system(s) only, but the issue happens on any non-GuixSD systemrunning Guix on a foreign distribution.
I am aware there may be workarounds, and currently I'm using theworkaround as specified in the bug report, but if this is _NOT_ a bug,then I shall continue to use my workaround.
It does seem to me that this is indeed a bug, as Guix behavesdifferently based upon who is executing it.
Toggle quote (19 lines)> > > > 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.> > > > > > > This does make sense, if that is somehow only read from a non-store> > location (I'm not sure why it would be, that seems against all the> > point of guix in the first place).> > I am not sure to understand what you mean.> > > Do the explanations help?> > All the best,> simon>
Z
Z
zimoun wrote on 16 Sep 2020 11:33
(name . Steffen Rytter Postas)(address . nc@scalehost.eu)(address . 42810@debbugs.gnu.org)
CAJ3okZ1rdnfHHVPtYzOMfJBQeXacT4abrgwdUjfn138ThJ5FUA@mail.gmail.com
Dear,
On Wed, 16 Sep 2020 at 09:35, Steffen Rytter Postas <nc@scalehost.eu> wrote:
Toggle quote (6 lines)> This may well be the point of Guix, and maybe I'm' following too much> of a classical paradigm, but for me on a classical Linux desktop> system, it is much easier for me to just use _one_ version of Guix,> regardless of using it as my own user, or installing applications as> root.
You are using Guix on foreign distro, right?Therefore, the concept of "installing applications as root" does notapply any more.There is _one_ version of Guix, the one you use as regular user.And as said before, "sudo guix pull" just updates the daemon and fortypical use-cases (not Guix developer), you can do that only each fullmoon. :-)

Toggle quote (4 lines)> I'm not sure why this should _not_ work. What is the arguments against> my use case? Is it that each user _MUST_ run `guix pull` as their own> user and _NEVER_ use the system-wide Guix with local channels?
There is no argument against. You use case should work, you just needto set up correctly, with for example:
sudo guix pull -p /usr/
But it is not standard for Guix. That's why you need a bit of more work.

Otherwise, yes each user runs "guix pull" as their own user and neveruses the system-wide Guix.Each user specifies their own local channels. If the sysadmin wantsthat each user pulls with a specific channels file, the easiest is toadd a symlink from ~/.config/guix/current/channels.scm to say/etc/guix/channels.scm for all the users on the machine.
On the machine, 2 users can run different Guix and so installdifferent versions of the same packages. That's why it is importantto report the "guix describe" of the user.

Toggle quote (4 lines)> I do not mind being able to by-pass any setup I've made. This is for my> own system(s) only, but the issue happens on any non-GuixSD system> running Guix on a foreign distribution.
I am not sure there is an issue but an incorrect setup. :-)

Toggle quote (4 lines)> I am aware there may be workarounds, and currently I'm using the> workaround as specified in the bug report, but if this is _NOT_ a bug,> then I shall continue to use my workaround.
I am not convinced it is a bug. But I can have wrong and miss something.

Toggle quote (3 lines)> It does seem to me that this is indeed a bug, as Guix behaves> differently based upon who is executing it.
Yes, it is expected.
For example, I am running Guix on a Debian.There is: - the system-wide Guix version at version f6dfe42 (4 "guix pull" andlast on Sep 15 2020 01:42:11) - user kioo at the version 1a9af96 (1 "guix pull" and last on Apr 182020 20:13:23) - mine at the version 9e7b265 (44 "guix pull" and last on Sep 16 2020 11:28:36)
Well, the sysadmin did "guix pull" 4 times and me I did 44 times, soclearly the command 'guix' behaves differently based upon who isexecuting it.
For example, if the user kikoo run "guix install emacs" then they willinstall the version 26.3. and me instead wll install version 27.1,
If I want to install the same version as the user kikoo, I can do:
guix pull --commit=1a9af96 guix install emacs
or better:
guix time-machine --commit=1a9af96 -- install emacs
The first will create another generation and my version of Guix willbe at 1a9af96. Which is not a good Guix practise, IMHO.Instead, the second creates a temporary version of Guix and use it toinstall the package emacs; without polluting my version of guix.

Does it make sense?
All the best,simon
S
S
Steffen Rytter Postas wrote on 16 Sep 2020 12:24
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 42810@debbugs.gnu.org)
a6b2f0f978316b0296607c52460786f21c3d979c.camel@scalehost.eu
Hi,
ons, 16 09 2020 kl. 11:33 +0200, skrev zimoun:
Toggle quote (23 lines)> Dear,> > On Wed, 16 Sep 2020 at 09:35, Steffen Rytter Postas <nc@scalehost.eu>> wrote:> > > This may well be the point of Guix, and maybe I'm' following too> > much> > of a classical paradigm, but for me on a classical Linux desktop> > system, it is much easier for me to just use _one_ version of Guix,> > regardless of using it as my own user, or installing applications> > as> > root.> > You are using Guix on foreign distro, right?> Therefore, the concept of "installing applications as root" does not> apply any more.> There is _one_ version of Guix, the one you use as regular user.> And as said before, "sudo guix pull" just updates the daemon and for> typical use-cases (not Guix developer), you can do that only each> full> moon. :-)>
Why does the concept of installing applications as root not apply?While I am aware that all applications are installed in the /gnu/store,this does not imply that there are different application needs betweenthe root user and a normal user.
Toggle quote (29 lines)> > > I'm not sure why this should _not_ work. What is the arguments> > against> > my use case? Is it that each user _MUST_ run `guix pull` as their> > own> > user and _NEVER_ use the system-wide Guix with local channels?> > There is no argument against. You use case should work, you just> need> to set up correctly, with for example:> > sudo guix pull -p /usr/> > But it is not standard for Guix. That's why you need a bit of more> work.> > > Otherwise, yes each user runs "guix pull" as their own user and never> uses the system-wide Guix.> Each user specifies their own local channels. If the sysadmin wants> that each user pulls with a specific channels file, the easiest is to> add a symlink from ~/.config/guix/current/channels.scm to say> /etc/guix/channels.scm for all the users on the machine.> > On the machine, 2 users can run different Guix and so install> different versions of the same packages. That's why it is important> to report the "guix describe" of the user.>
So rather than being a bug in Guix itself, it's a bug in theinstallation script that does not setup the host distribution for beingable to process the correct location then, no?
Or if it's because the user of Guix on a foreign distribution needs tosetup more for the use case of adding channels to work, when runningonly one version of guix on the system, then it would be missingdocumentation.
While I don't have a say in this, I also do not mind changing this froma bug of guix to an issue somewhere else, but where would it be? Or isthe casual user of guix that elects to simply add a channel simply leftto their own devices on undocumented behaviour?
Toggle quote (60 lines)> > > I do not mind being able to by-pass any setup I've made. This is> > for my> > own system(s) only, but the issue happens on any non-GuixSD system> > running Guix on a foreign distribution.> > I am not sure there is an issue but an incorrect setup. :-)> > > > I am aware there may be workarounds, and currently I'm using the> > workaround as specified in the bug report, but if this is _NOT_ a> > bug,> > then I shall continue to use my workaround.> > I am not convinced it is a bug. But I can have wrong and miss> something.> > > > It does seem to me that this is indeed a bug, as Guix behaves> > differently based upon who is executing it.> > Yes, it is expected.> > For example, I am running Guix on a Debian.> There is:> - the system-wide Guix version at version f6dfe42 (4 "guix pull" and> last on Sep 15 2020 01:42:11)> - user kioo at the version 1a9af96 (1 "guix pull" and last on Apr 18> 2020 20:13:23)> - mine at the version 9e7b265 (44 "guix pull" and last on Sep 16> 2020 11:28:36)> > Well, the sysadmin did "guix pull" 4 times and me I did 44 times, so> clearly the command 'guix' behaves differently based upon who is> executing it.> > For example, if the user kikoo run "guix install emacs" then they> will> install the version 26.3. and me instead wll install version 27.1,> > If I want to install the same version as the user kikoo, I can do:> > guix pull --commit=1a9af96> guix install emacs> > or better:> > guix time-machine --commit=1a9af96 -- install emacs> > The first will create another generation and my version of Guix will> be at 1a9af96. Which is not a good Guix practise, IMHO.> Instead, the second creates a temporary version of Guix and use it to> install the package emacs; without polluting my version of guix.> > > Does it make sense?> > All the best,> simon>
Z
Z
zimoun wrote on 16 Sep 2020 13:01
(name . Steffen Rytter Postas)(address . nc@scalehost.eu)(address . 42810@debbugs.gnu.org)
CAJ3okZ3HuukJCN2NT7+2D1=69ew91DVJUN_EexPk3COQs_A39A@mail.gmail.com
Dear,
On Wed, 16 Sep 2020 at 12:24, Steffen Rytter Postas <nc@scalehost.eu> wrote:
Toggle quote (2 lines)> Why does the concept of installing applications as root not apply?
Because one of the Guix aims is to be "root-less". Each user is doingwhatever they wants in their $HOME directory.On foreign distro, the only role of the sysadmin (root) is to update the daemon.
Toggle quote (4 lines)> While I am aware that all applications are installed in the /gnu/store,> this does not imply that there are different application needs between> the root user and a normal user.
I am not sure to understand what it means.

Toggle quote (4 lines)> So rather than being a bug in Guix itself, it's a bug in the> installation script that does not setup the host distribution for being> able to process the correct location then, no?
What do you mean by "correct location"?
You could be interested by these tutorial videos:
< https://guix.gnu.org/videos/

Toggle quote (5 lines)> Or if it's because the user of Guix on a foreign distribution needs to> setup more for the use case of adding channels to work, when running> only one version of guix on the system, then it would be missing> documentation.
I am sorry, I do not understand what you mean.
Toggle quote (5 lines)> While I don't have a say in this, I also do not mind changing this from> a bug of guix to an issue somewhere else, but where would it be? Or is> the casual user of guix that elects to simply add a channel simply left> to their own devices on undocumented behaviour?
Again, I am sorry too because I miss what you mean.

Maybe you could send your comments on the mailing list<help-guix@gnu.org> and others will have better wordings than mine.:-)
All the best,simon
Z
Z
zimoun wrote on 28 Oct 2020 19:35
tags 42810 moreinfo
(address . control@debbugs.gnu.org)
86zh46yzaa.fsf@gmail.com
tags 42810 moreinfothanks
?