From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCko5-0001Wr-Kq for guix-patches@gnu.org; Wed, 17 Oct 2018 08:20:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCko1-0001kH-8B for guix-patches@gnu.org; Wed, 17 Oct 2018 08:20:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:50226) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCkny-0001gy-Qm for guix-patches@gnu.org; Wed, 17 Oct 2018 08:20:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gCkny-0007w5-Il for guix-patches@gnu.org; Wed, 17 Oct 2018 08:20:02 -0400 Subject: [bug#30254] [bug#30256] [PATCH 3/3] scripts: environment: Add --no-cwd. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87vag2wopo.fsf@gnu.org> <7bc71eaa3cff48ec7dc0d4fe406dde9482b716a9.1516937216.git.mtg@gnu.org> <87tvtyhhnd.fsf@gnu.org> Date: Wed, 17 Oct 2018 14:19:33 +0200 In-Reply-To: <87tvtyhhnd.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 02 Mar 2018 11:54:30 +0100") Message-ID: <87murcdaui.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Mike Gerwitz Cc: 30254@debbugs.gnu.org, 30256@debbugs.gnu.org Hello Mike, There=E2=80=99s this last patch from the series you submitted a while back that=E2=80=99s ready modulo an issue with the test. Could you take a look? TIA, Ludo=E2=80=99. ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > Mike Gerwitz skribis: > >> * doc/guix.texi (Invoking guix environment): Add --no-cwd. >> * guix/scripts/environment.scm (show-help, %options): Add --no-cwd. >> (launch-environment/container): Add 'map-cwd?' param; only add mapping f= or cwd >> if #t. Only change to cwd within container if #t, otherwise home. >> (guix-environment): Error if --no-cwd without --container. Provide '(not >> no-cwd?)' to launch-environment/container as 'map-cwd?'. >> * tests/guix-environment.sh: Add test for no-cwd. > > This one LGTM as well (with the test moved to > guix-environment-container.sh). There=E2=80=99s just a minor issue: > >> --- a/tests/guix-environment.sh >> +++ b/tests/guix-environment.sh >> @@ -84,6 +84,14 @@ HOME=3D"$tmpdir" guix environment --bootstrap --conta= iner --user=3Dfoognu \ >> --share=3D"$tmpdir/umock" \ >> -- guile -c "$usertest" >>=20=20 >> +# if not sharing CWD, chdir home >> +( >> + cd "$tmpdir" \ >> + && guix environment --bootstrap --container --no-cwd --user=3Dfoo \ >> + --ad-hoc guile-bootstrap --pure \ >> + -- /bin/sh -c 'test $(pwd) =3D=3D "/home/foo" -a ! -d '"$tm= pdir" >> +) >> + > > This test would fail for me because my test store is at > ~ludo/src/guix/test-tmp/store and my CWD is ~/src/guix. So when using > both --user and --no-cwd, the effect is that > ~ludo/src/guix/test-tmp/store is not available at all within the > container, and thus execve("/bin/sh") fails with ENOENT: > > $ ./test-env guix environment --bootstrap --container --no-cwd --user=3Df= oo --ad-hoc guile-bootstrap > accepted connection from pid 29684, user ludo > accepted connection from pid 29695, user ludo > ./test-env: line 1: 29683 Terminated "/home/ludo/src/guix/pr= e-inst-env" "/home/ludo/src/guix/guix-daemon" --disable-chroot --substitute= -urls=3D"$GUIX_BINARY_SUBSTITUTE_URL" > $ echo $? > 1 > > Thoughts? > > TIA, > Ludo=E2=80=99.