From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erp1M-0001yP-1f for guix-patches@gnu.org; Fri, 02 Mar 2018 13:03:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erp1L-0002Iz-2S for guix-patches@gnu.org; Fri, 02 Mar 2018 13:03:04 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:33611) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1erp1K-0002Ip-Ua for guix-patches@gnu.org; Fri, 02 Mar 2018 13:03:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1erp1K-00073k-Iz for guix-patches@gnu.org; Fri, 02 Mar 2018 13:03:02 -0500 Subject: [bug#30256] [PATCH 3/3] scripts: environment: Add --no-cwd. Resent-Message-ID: From: Mike Gerwitz 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") Date: Fri, 02 Mar 2018 13:00:36 -0500 Message-ID: <877equgxx7.fsf@gnu.org> References: <87vag2wopo.fsf@gnu.org> <7bc71eaa3cff48ec7dc0d4fe406dde9482b716a9.1516937216.git.mtg@gnu.org> <87tvtyhhnd.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30256@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hey, Ludo! Sorry I've been silent on the script you provided to me---between my GNU volunteer work and preparing for my LP2018 talk, I've had no free time, so I haven't even looked at it yet. After the conference I'll have the time to collaborate a bit more. Also---I thought the decision was that this patchset was inappropriate for `guix environment`; did I misinterpret? On Fri, Mar 02, 2018 at 11:54:30 +0100, Ludovic Court=C3=A8s wrote: >> --- 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? I admit that I forgot some of the implementation details of my own patch; I'd have to look at it in more detail. I'll consider it tonight or this weekend. Thanks for taking a look at and applying these. If there are better solutions, I'm fine with that---I just wanted a proof-of-concept to start the discussion. Though, starting the discussion and then ducking out for other obligations wasn't quite what I had in mind... =2D-=20 Mike Gerwitz Free Software Hacker+Activist | GNU Maintainer & Volunteer GPG: D6E9 B930 028A 6C38 F43B 2388 FEF6 3574 5E6F 6D05 https://mikegerwitz.com --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJamZFFAAoJEIyRe39dxRuiRkkQAIqrzkOPRrupZM0e2+w8B207 2Yyd8Fh4kFnis7FBpDJ9kz+FOiD3mpWYzfmCFQr/Z7CrPYVevnNXqS9sYtibKeNu laV9dHt9LtBtWAfmwLu+DAqpOD/SCGZn8fRhWJNBwvYmq+Ojqi2PvLfhsQlXStWL XB4ccwkCd4H+Y9JxXetT3pLQw1xLDAHnphTshU9DQ+E4qfnA5uX/wclwMzwhuYT/ kFvP40fvXVrZMLieAaQNGFNnBfiQy4/iyoOCNWVkSZYUXXflzmROuTkXePxdTtXv JRsOzgVrdQMZoxFhyuwOB+XSq4S9Q1MVE8jeZGZ2ndyx1LLLYlsm8xtcr1W2wG4B xq573Sqn+vvciwhAaRYt9pTIAAPYY2eMJz55rI0TysNbgzwlfJJABqtaytn4NmTL heBEAGPcjmDcWwMkfFz001jA64NuhS0oJMcq2TZ+Zlh8+OqBwO0Ywua1R+8BoprI BRmfJwdTcIAvo1PSPnTcMSLeOBK5s69Y74ibAQlGVxlHpLeCVjC+O3SnuauYNGMg UewzSKOUD0kZ7xePy1Oia0K2VfmNVAH91FivfFvlK2st9gpNVqwj1vT7SQhC2SaG WtMeFA2++ZEnGdpZRg5OjWId9cn1BoJRQHBWfLlq1mBVWA7b+AvEhJgc24DNhz/c gDSoXDkj+c00/ZRtx6CB =JVGH -----END PGP SIGNATURE----- --=-=-=--