From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: [PATCH 14/15] scripts: environment: Add --container option. Date: Fri, 30 Oct 2015 21:25:46 -0400 Message-ID: References: <1436188604-2813-1-git-send-email-dthompson2@worcester.edu> <1436188604-2813-14-git-send-email-dthompson2@worcester.edu> <87zj38f326.fsf@gnu.org> <87oah93zbk.fsf@gnu.org> <87a8rpyzb9.fsf@gnu.org> <87d1wdn72e.fsf@gnu.org> <87k2qak4sb.fsf@gnu.org> <874mhcy5yz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsKvT-0007Gf-RT for guix-devel@gnu.org; Fri, 30 Oct 2015 21:25:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsKvS-0003i4-V6 for guix-devel@gnu.org; Fri, 30 Oct 2015 21:25:47 -0400 Received: from mail-yk0-x236.google.com ([2607:f8b0:4002:c07::236]:35757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsKvS-0003hg-Qg for guix-devel@gnu.org; Fri, 30 Oct 2015 21:25:46 -0400 Received: by ykek133 with SMTP id k133so93484959yke.2 for ; Fri, 30 Oct 2015 18:25:46 -0700 (PDT) In-Reply-To: <874mhcy5yz.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Cc: guix-devel , David Thompson Hello, sorry for the delay. On Tue, Oct 27, 2015 at 6:13 AM, Ludovic Court=C3=A8s wrote: > Hello! > > One thing I noticed is that =E2=80=98guix environment --container=E2=80= =99 behaves > sub-optimally when =E2=80=98SHELL=E2=80=99 is set or set to the empty str= ing: > > --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=3D guix environment alta --pure --container > In execvp of : No such file or directory > --8<---------------cut here---------------end--------------->8--- > > One has to explicitly =E2=80=98unset SHELL=E2=80=99 to sidestep the probl= em. 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, =E2=80=98SHELL=E2=80=99 is overridden in the environment: > > --8<---------------cut here---------------start------------->8--- > $ echo $SHELL > /home/ludo/.guix-profile/bin/bash > $ guix environment alta --container --expose=3D$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/b= in/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=E2=80=99m not sure if =E2=80=98SHELL=E2=80=99 should be added to =E2=80= =98%precious-variables=E2=80=99. 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