unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Is there any way to change what /bin/sh is inside `guix shell [--container]` ?
@ 2023-03-13 20:16 Zack Weinberg
  2023-03-16 15:50 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Zack Weinberg @ 2023-03-13 20:16 UTC (permalink / raw)
  To: help-guix

I'm doing experiments with using `guix shell --container` for isolated, reproducible build environments.  I've noticed that no matter how I set up the container, `/bin/sh` points to a full-fat bash, even if the full bash package was not included in the container profile.  For instance

```
guix shell --container bash-minimal coreutils -- sh -c 'ls -l $(command -v sh) /bin/sh'
lrwxrwxrwx 1 zack  users    61 Mar 13 20:07 /bin/sh -> /gnu/store/d99ykvj3axzzidygsmdmzxah4lvxd6hw-bash-5.1.8/bin/sh
lrwxrwxrwx 1 65534 overflow 69 Jan  1  1970 /gnu/store/jc86p6d0i5b3aly5lx5lhb1xa35f2xk8-profile/bin/sh -> /gnu/store/chfwin3a4qp1znnpsjbmydr2jbzk0d6y-bash-minimal-5.1.8/bin/sh

$ guix shell --container busybox -- sh -c 'ls -l $(command -v sh) /bin/sh'
lrwxrwxrwx    1 65534    overflow         7 Jan  1  1970 /gnu/store/96l76flyg617l23c5p32ysjbc72ywjgd-profile/bin/sh -> busybox
lrwxrwxrwx    1 zack       users           61 Mar 13 20:05 /bin/sh -> /gnu/store/d99ykvj3axzzidygsmdmzxah4lvxd6hw-bash-5.1.8/bin/sh
```

Is there any way to change or override this behavior?  What I want is for /bin/sh inside the container to be the same as $GUIX_ENVIRONMENT/bin/sh inside the container.

(If you're about to ask me, "but what if the container profile doesn't include a shell at all?", my response will be "in that case /bin/sh should not exist!"  I can think of several reasons why I might do that on purpose.  Yes, I realize that system(3) won't work in such an environment -- that may in fact be (one of the) goals.)

zw


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-20 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-13 20:16 Is there any way to change what /bin/sh is inside `guix shell [--container]` ? Zack Weinberg
2023-03-16 15:50 ` Ludovic Courtès
2023-03-20 15:14   ` Zack Weinberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).