Subject: Re: bug#30728: guix-install.sh doesn't work if run with "sudo"

From: Clément Lassieur <[email-masked]>
Date: Thu, 29 Mar 2018 10:04:32 +0200

Chris Marusich <[email-masked]> writes:

> Clément Lassieur <[email-masked]> writes:
>
>> Ricardo Wurmus <[email-masked]> writes:
>>
>>> Clément Lassieur <[email-masked]> writes:
>>>
>>>>> The manual says (see: (guix) Binary Installation):
>>>>>
>>>>>   3. Make ‘root’’s profile available under ‘~/.guix-profile’:
>>>>>
>>>>>           # ln -sf /var/guix/profiles/per-user/root/guix-profile \
>>>>>                    ~root/.guix-profile
>>>>
>>>> I think the manual is wrong here.  This only makes sense if the user is
>>>> 'root'.  Otherwise, the user would expect Guix to be installed in their
>>>> home, not in root's home.
>>>
>>> Step 2 says “As root, run: […]”.  “~root” resolves to “/root”, not to
>>> “$HOME/root”, so it even works when run as a regular user.
>>>
>>> The manual seems correct to me and this is what the script aims to
>>> implement.
>>
>> But ~/.guix-profile may resolve to /home/user/.guix-profile.  So it
>> should be ~root/.guix-profile instead of ~/.guix-profile.
>
> Ah, I think I now see the cause of our miscommunication.
>
> It's possible to interpret the manual's use of ~ and $HOME to mean "the
> unprivileged user's home directory", instead of "root's home directory".
> I think that's a mistake in the manual, since the "ln" clearly makes
> root's profile available under root's home directory, and the step
> involving $HOME doesn't make sense unless $HOME expands to root's home
> directory.
>
> I've updated my patch; it now also changes the following line...
>
>   3. Make ‘root’’s profile available under ‘~/.guix-profile’:
>
> ...to this:
>
>   3. Make ‘root’’s profile available under ‘~root/.guix-profile’:
>
> How does that sound?

This fixes the documentation inconsistency, but I still think Guix
shouldn't be installed in ~root (as I explain there:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30728#32).