unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: "Zack Weinberg" <zack@owlfolio.org>
To: help-guix@gnu.org
Subject: Is there any way to change what /bin/sh is inside `guix shell [--container]` ?
Date: Mon, 13 Mar 2023 16:16:41 -0400	[thread overview]
Message-ID: <87ac5c3b-d275-496a-a84d-dcda520a6499@app.fastmail.com> (raw)

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


             reply	other threads:[~2023-03-13 20:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 20:16 Zack Weinberg [this message]
2023-03-16 15:50 ` Is there any way to change what /bin/sh is inside `guix shell [--container]` ? Ludovic Courtès
2023-03-20 15:14   ` Zack Weinberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ac5c3b-d275-496a-a84d-dcda520a6499@app.fastmail.com \
    --to=zack@owlfolio.org \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).