[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: guix gc doesn't seem to clean old guix revision

Subject: RE: guix gc doesn't seem to clean old guix revision
Date: Mon, 2 Dec 2019 20:55:08 +0000

> > > As said, it is not a bug of "guix pull" but a bug of the
> > > configuration. Adding the root user to your Dockerfile should fix the
> > > issue you encounter.
> >
> > The fact that guix require $USER to be set is IMO a kind of bug and is
> > documented anywhere.

> I do not understand: running without any $USER is kind of very special
> edge case.

It is not special at all, $USER is only set when using a login shell.
So if you script some guix commands (who doesn't use a login shell),
it broke as it broke with my tests.

> In your configuration file [1], you create everything with the
> (non-existent) root user and you are doing as they exists, i.e, ENV
> PATH, "ln -s", etc. then "guix pull" and because there is no user,
> Guix creates the default profile.
> I do not see where there is a bug. Guix does not break and it is a
> misconfiguration.
> IMO, the bug comes from your configuration file. The fix is: create an
> user or correctly symlink the profile
> (/var/guix/profiles/default/current-guix instead of
> /var/guix/profiles/per-user/root/current-guix).

The user already exists, the only problem I had was that my commands
was running with a non-login login shell, so $USER was not set and had to force the
set of $USER in a wrapper to allow guix to works without linux shell.

> However, I totally agree with you that it lacks documentation about
> this user case. Where do you suggest to add such information? A
> warning note in the binary installation section [2]? Something else?

It is not an installation problem but a usage problem, so every commands
who need $USER/$HOME should have a warning about the need to have
those variables set.

> [1]
> [2]

> > It will be less prone to errors to relay for $USER on something like
> > `whoami` and for $HOME expanding `~$USER`.

> What do you mean?
> If there is no user, then there is no user. :-)

There is a user, this is just that the shell used is not a login shell.
Since $USER/$HOME are only set when using a login shell, it is
better to use `whoami` in place of $USER and expand ~$(whoami)
in place of $HOME in scripts to be sure to have the right values even
when using a non-login shell or to avoid errors if $USER was override.

> > So, not sure if it is normal, but it seems there is an overhead of 166Mo
> > between the binary version and after doing 'guix pull' and 'guix gc'.

> Interesting. It should deserve more investigation why. :-)

> All the best,
> simon


reply via email to

[Prev in Thread] Current Thread [Next in Thread]