[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#30254] [bug#30256] [PATCH 3/3] scripts: environment: Add --no-cwd.
From: |
Ludovic Courtès |
Subject: |
[bug#30254] [bug#30256] [PATCH 3/3] scripts: environment: Add --no-cwd. |
Date: |
Wed, 17 Oct 2018 14:19:33 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Hello Mike,
There’s this last patch from the series you submitted a while back
that’s ready modulo an issue with the test. Could you take a look?
TIA,
Ludo’.
address@hidden (Ludovic Courtès) skribis:
> Mike Gerwitz <address@hidden> 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 for
>> 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’s just a minor issue:
>
>> --- a/tests/guix-environment.sh
>> +++ b/tests/guix-environment.sh
>> @@ -84,6 +84,14 @@ HOME="$tmpdir" guix environment --bootstrap --container
>> --user=foognu \
>> --share="$tmpdir/umock" \
>> -- guile -c "$usertest"
>>
>> +# if not sharing CWD, chdir home
>> +(
>> + cd "$tmpdir" \
>> + && guix environment --bootstrap --container --no-cwd --user=foo \
>> + --ad-hoc guile-bootstrap --pure \
>> + -- /bin/sh -c 'test $(pwd) == "/home/foo" -a ! -d '"$tmpdir"
>> +)
>> +
>
> 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=foo
> --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/pre-inst-env" "/home/ludo/src/guix/guix-daemon"
> --disable-chroot --substitute-urls="$GUIX_BINARY_SUBSTITUTE_URL"
> $ echo $?
> 1
>
> Thoughts?
>
> TIA,
> Ludo’.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug#30254] [bug#30256] [PATCH 3/3] scripts: environment: Add --no-cwd.,
Ludovic Courtès <=