guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 14/15] scripts: environment: Add --container option.


From: Thompson, David
Subject: Re: [PATCH 14/15] scripts: environment: Add --container option.
Date: Fri, 30 Oct 2015 21:25:46 -0400

Hello, sorry for the delay.

On Tue, Oct 27, 2015 at 6:13 AM, Ludovic Courtès <address@hidden> wrote:
> Hello!
>
> One thing I noticed is that ‘guix environment --container’ behaves
> sub-optimally when ‘SHELL’ is set or set to the empty string:
>
> --8<---------------cut here---------------start------------->8---
> $ guix environment alta --pure --container
>
> [...]
>
> In execvp of /home/ludo/.guix-profile/bin/bash: No such file or directory
> $ SHELL= guix environment alta --pure --container
> In execvp of : No such file or directory
> --8<---------------cut here---------------end--------------->8---
>
> One has to explicitly ‘unset SHELL’ to sidestep the problem.  This may
> be confusing to newcomers.

Yes, I know about this, but I'm not sure of a good solution.

> What about automatically mapping $SHELL in the container when it is set?

The issue is that the default command to evaluate is $SHELL or
"/bin/sh."  You can be almost certain that $SHELL is not going to be
available in the container.  What to do?  Check if the command is
'equal?' to (list (getenv "SHELL")) and make it '("/bin/sh") instead?

> Also, ‘SHELL’ is overridden in the environment:
>
> --8<---------------cut here---------------start------------->8---
> $ echo $SHELL
> /home/ludo/.guix-profile/bin/bash
> $ guix environment alta --container --expose=$SHELL
> bash-4.3# echo $SHELL
> /bin/sh
> # ls -l /proc/2/exe
> lrwxrwxrwx 1 0 0 0 Oct 27 10:11 /proc/2/exe -> 
> /home/ludo/.guix-profile/bin/bash
> bash-4.3# ls -l /home/ludo/.guix-profile/bin/bash
> -r-xr-xr-x 2 65534 65534 917320 Jan  1  1970 /home/ludo/.guix-profile/bin/bash
> --8<---------------cut here---------------end--------------->8---
>
> I’m not sure if ‘SHELL’ should be added to ‘%precious-variables’.

I don't think so, because of the issue mentioned above.  I'm thinking
that the default shell should remain the Bash we mount at /bin/sh.

Open to, and looking for, ideas to improve things.  Let me know what
you think of all this.

- Dave



reply via email to

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