(address . bug-guix@gnu.org)
Hi,
I've grown so used to using "guix environment," I thought I'd try out
"guix shell." It looks pretty neat! It's good to try to improve the
CLI.
However, when I tried "guix shell," I quickly observed this confusing
behavior:
Toggle snippet (57 lines)
[130] marusich@suzaku:~/guix-master
$ guix shell --container --check -D guix
guix shell: checking the environment variables visible from shell '/bin/bash'...
guix shell: warning: variable 'PKG_CONFIG_PATH' is missing from shell environment
hint: One or more environment variables have a different value in the shell than
the one we set. This means that you may find yourself running code in an
environment different from the one you asked Guix to prepare.
This usually indicates that your shell startup files are unexpectedly
modifying those environment variables. For example, if you are using Bash,
make sure that environment variables are set or modified in
`~/.bash_profile' and _not_ in `~/.bashrc'. For more information on Bash
startup files, run:
info "(bash) Bash Startup Files"
Alternatively, you can avoid the problem by passing the `--container' or
`-C' option. That will give you a fully isolated environment running in a
"container", immune to the issue described above.
[1] marusich@suzaku:~/guix-master
$ env | grep PKG_CONF
[1] marusich@suzaku:~/guix-master
$ guix shell --check -D guix
guix shell: checking the environment variables visible from shell '/bin/bash'...
guix shell: warning: variable 'PKG_CONFIG_PATH' is missing from shell environment
hint: One or more environment variables have a different value in the shell than
the one we set. This means that you may find yourself running code in an
environment different from the one you asked Guix to prepare.
This usually indicates that your shell startup files are unexpectedly
modifying those environment variables. For example, if you are using Bash,
make sure that environment variables are set or modified in
`~/.bash_profile' and _not_ in `~/.bashrc'. For more information on Bash
startup files, run:
info "(bash) Bash Startup Files"
Alternatively, you can avoid the problem by passing the `--container' or
`-C' option. That will give you a fully isolated environment running in a
"container", immune to the issue described above.
[1] marusich@suzaku:~/guix-master
$ guix shell -D guix
[0] [env] marusich@suzaku:~/guix-master
$ env | grep PKG
PKG_CONFIG_PATH=/gnu/store/qr79b2m6cfdj8ar7g0psqg4hglm6djfm-profile/lib/pkgconfig
[0] [env] marusich@suzaku:~/guix-master
$
exit
[0] marusich@suzaku:~/guix-master
$ guix shell --container -D guix
marusich@suzaku ~/guix-master [env]$ env | grep PKG
PKG_CONFIG_PATH=/gnu/store/qr79b2m6cfdj8ar7g0psqg4hglm6djfm-profile/lib/pkgconfig
marusich@suzaku ~/guix-master [env]$
I found the following things to be confusing:
(1) The error message claims that PKG_CONFIG_PATH is "missing from shell
environment." However, it seems to be present when I run "env".
(2) It says I can avoid the problem by passing the `--container' option,
but even when I do that, the problem seems to persist. If that is
expected behavior, then perhaps the wording should be changed to
something less certain, such as "you might be able to avoid the
problem". It does not seem to be the case that I can avoid the problem
by passing the `--container' option in this case.
What's really going on here? It's good to be able to look at this
feature with the eyes of a newbie, since I'm very used to using "guix
environment", but "guix shell" is totally new to me. I thought it would
be a good opportunity to provide feedback.
--
Chris
-----BEGIN PGP SIGNATURE-----
iQJJBAEBCAAzFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAmHnhXwVHGNtbWFydXNp
Y2hAZ21haWwuY29tAAoJEN1AmhXYIkadWR8QANlUC+4jvnGuBlBna2hZl3Qzups+
YBT9EryqYYJxPMY/9IY/cq62nwgtr15WGy03jZjox2cRfimgMBN4u24eY9Mx51hn
Ew7IQR/Cq951q6QOP077Av1hZ7Ey3kJPtln6aUYbLfzo8AT/8/iUpjJZ19vxPiye
gsP4/6AtoCqMFKfw6KQubHzaJAhOJ7I08Ztyr5DYx5IEjhnT/T2D/hk4gMggNs2y
gaWzw/9FXISYl88rsbB3e0WsWBmtvbXkY5wZLJqytcyfmVhINHcAAWof+OhsA0CK
Ngb8uNXtwn4eB1/O6wSCCKk8pDOlZwZ/PzmmlIKHMwRlTu1EVe+r0eF2+dvyjWRM
L7d5hlFYkCBl/y45IYhEE+W3GuDvZzSYenYVoa5KiRPe/dbFvBlwkA7p/5jCZBNJ
yok5EF3t6/EQhicuTYEGfqJUdQHPwXeQpuIYP59dOsuxwa6KkuzTP6kmMM8rJtjL
FjgB9tq4dAX+x49Oo37mwvG0jjMoJdIVRZBBmhloenPPJLqbdK5T1YEnN3PCwfXW
gqT181jznOFXcFCz1/6KzPlDdyb7dXOi9ZyaOrGJSGt17PKKc04YHBLb+d/2sPKC
pvohNZM+VJlwLkn0JSuX2Pv+YbuSI+U+T31/F0wdSgYlj0R8Z1vYqj1S1wSrep0y
2esEmSKqCxXR2V/s
=E1CA
-----END PGP SIGNATURE-----