all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: "Thompson, David" <dthompson2@worcester.edu>
Cc: guix-devel <guix-devel@gnu.org>, David Thompson <davet@gnu.org>
Subject: Re: [PATCH 14/15] scripts: environment: Add --container option.
Date: Sun, 11 Oct 2015 21:34:18 +0200	[thread overview]
Message-ID: <87a8rpyzb9.fsf@gnu.org> (raw)
In-Reply-To: <CAJ=RwfY8bs4hSXaN0SyTAZy89k4QFY=jG-vzLkarudkD9Q6Agg@mail.gmail.com> (David Thompson's message of "Sat, 10 Oct 2015 17:11:41 -0400")

Hi!

I think I got it.  First, note that:

--8<---------------cut here---------------start------------->8---
$ guix build guile-bootstrap 
/gnu/store/aiz8db2gni401wc9fgidmcggxyb1czis-guile-bootstrap-2.0
$ cat /gnu/store/aiz8db2gni401wc9fgidmcggxyb1czis-guile-bootstrap-2.0/bin/guile 
#!/gnu/store/gvwf71vddp8c1d7ydqg02p43mgdjrx6s-bash
export GUILE_SYSTEM_PATH=/gnu/store/aiz8db2gni401wc9fgidmcggxyb1czis-guile-bootstrap-2.0/share/guile/2.0
export GUILE_SYSTEM_COMPILED_PATH=/gnu/store/aiz8db2gni401wc9fgidmcggxyb1czis-guile-bootstrap-2.0/lib/guile/2.0/ccache
exec -a "$0" /gnu/store/aiz8db2gni401wc9fgidmcggxyb1czis-guile-bootstrap-2.0/bin/.guile-real "$@"
--8<---------------cut here---------------end--------------->8---

So:

> [pid 32626] execve("/home/dave/Code/guix/test-tmp/store/w8fsskwxr793yq6w3368x5k1p07syi3h-guile-bootstrap-2.0/bin/guile", ["guile", "-c", "(exit 42)"], [/* 6 vars */]) = -1 ENOEXEC (Exec format error)
> [pid 32626] execve("/gnu/store/sybvv7vqvqqmijpn2ql1p6yk61cr5y3k-bash-static-4.3.39/bin/bash", ["/gnu/store/sybvv7vqvqqmijpn2ql1p"..., "/home/dave/Code/guix/test-tmp/st"..., "-c", "(exit 42)"], [/* 6 vars */]) = -1 ENOENT (No such file or directory)
> [pid 32626] write(2, "In execvp of guile: No such file"..., 46In execvp of guile: No such file or directory
> ) = 46

The first ‘execve’ fails.  The ‘execve’ comes from libc itself, which
notices ENOEXEC and thus falls back to interpreting the executable with
_PATH_BSHELL (see posix/execvpe.c.)

However, the _PATH_BSHELL that is taken here is the one from /gnu/store
rather than the one from /home/dave/Code/guix/test-tmp/…; this is
because that’s the _PATH_BSHELL value for the libc of the Guile that
runs ‘guix environment’.  (This is a problem in the test environment
because of the wrong _PATH_BSHELL, but it happens to work well out side
of the test environment.)

Now, I’m not sure why the first ‘execve’ shell; normally shebangs are
interpreted directly by the kernel, in fs/binfmt_script.c.

It seems that the file mentioned in the shebang of ‘guile’ is correctly
mapped:

> [pid 32625] mount("/home/dave/Code/guix/test-tmp/store/xh177jawf1hl22wm1rzfq7dgn9iz67jy-bash", "/tmp/guix-directory.Datz1K//home/dave/Code/guix/test-tmp/store/xh177jawf1hl22wm1rzfq7dgn9iz67jy-bash", 0x1d97b30, MS_RDONLY|MS_BIND, NULL) = 0
> [pid 32625] mount("/home/dave/Code/guix/test-tmp/store/xh177jawf1hl22wm1rzfq7dgn9iz67jy-bash", "/tmp/guix-directory.Datz1K//home/dave/Code/guix/test-tmp/store/xh177jawf1hl22wm1rzfq7dgn9iz67jy-bash", 0x13c3b30, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0

Could it be that it lacks the executable bit?

Ludo’.

  reply	other threads:[~2015-10-11 19:34 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 13:16 [PATCH 01/15] build: syscalls: Add additional mount flags David Thompson
2015-07-06 13:16 ` [PATCH 02/15] build: syscalls: Add unmount flags David Thompson
2015-07-07 14:50   ` Ludovic Courtès
2015-07-07 22:44     ` Thompson, David
2015-07-06 13:16 ` [PATCH 03/15] build: syscalls: Add mkdtemp! David Thompson
2015-07-07 13:15   ` Ludovic Courtès
2015-07-07 22:52     ` Thompson, David
2015-07-06 13:16 ` [PATCH 04/15] utils: Add call-with-temporary-directory David Thompson
2015-07-07 13:15   ` Ludovic Courtès
2015-07-07 22:54     ` Thompson, David
2015-07-06 13:16 ` [PATCH 05/15] build: syscalls: Add clone syscall wrapper David Thompson
2015-07-07 13:23   ` Ludovic Courtès
2015-07-08  0:28     ` Thompson, David
2015-07-11 10:18       ` Ludovic Courtès
2015-07-06 13:16 ` [PATCH 06/15] build: syscalls: Add setns " David Thompson
2015-07-07 13:28   ` Ludovic Courtès
2015-07-08  0:57     ` Thompson, David
2015-07-06 13:16 ` [PATCH 07/15] build: syscalls: Add pivot-root David Thompson
2015-07-07 13:35   ` Ludovic Courtès
2015-07-08  1:18     ` Thompson, David
2015-07-08 12:47       ` Ludovic Courtès
2015-07-06 13:16 ` [PATCH 08/15] gnu: build: Add Linux container module David Thompson
2015-07-07 13:51   ` Ludovic Courtès
2015-07-08 12:38     ` Thompson, David
2015-07-08 21:57       ` Ludovic Courtès
2015-07-09 12:56         ` Thompson, David
2015-07-06 13:16 ` [PATCH 09/15] gnu: system: Move <file-system-mapping> into (gnu system file-systems) David Thompson
2015-07-07 13:51   ` Ludovic Courtès
2015-07-08  1:21     ` Thompson, David
2015-07-06 13:16 ` [PATCH 10/15] gnu: system: Move file-system->spec to " David Thompson
2015-07-07 13:51   ` Ludovic Courtès
2015-07-08  1:22     ` Thompson, David
2015-07-06 13:16 ` [PATCH 11/15] gnu: system: Add Linux container module David Thompson
2015-07-07 13:55   ` Ludovic Courtès
2015-07-09 13:00     ` Thompson, David
2015-07-10 17:57       ` Ludovic Courtès
2015-07-06 13:16 ` [PATCH 12/15] gnu: system: Add Linux container file systems David Thompson
2015-07-07 13:56   ` Ludovic Courtès
2015-07-09 12:56     ` Thompson, David
2015-07-06 13:16 ` [PATCH 13/15] scripts: system: Add 'container' action David Thompson
2015-07-07 14:05   ` Ludovic Courtès
2015-10-27  0:24     ` Thompson, David
2015-10-27 17:41       ` Ludovic Courtès
2015-10-30 17:28         ` Thompson, David
2015-07-06 13:16 ` [PATCH 14/15] scripts: environment: Add --container option David Thompson
2015-07-07 14:35   ` Ludovic Courtès
2015-07-09 13:16     ` Thompson, David
2015-07-10 18:03       ` Ludovic Courtès
2015-09-05 23:45     ` Thompson, David
2015-09-11 12:39       ` Ludovic Courtès
2015-10-10 21:11         ` Thompson, David
2015-10-11 19:34           ` Ludovic Courtès [this message]
2015-10-17 10:05             ` Ludovic Courtès
2015-10-22  1:23               ` Thompson, David
2015-10-25 21:38                 ` Ludovic Courtès
2015-10-26  0:35                   ` Thompson, David
2015-10-27 10:13                     ` Ludovic Courtès
2015-10-31  1:25                       ` Thompson, David
2015-10-31 10:28                         ` Ludovic Courtès
2015-07-06 13:16 ` [PATCH 15/15] scripts: Add 'container' subcommand David Thompson
2015-07-07 14:50   ` Ludovic Courtès
2015-10-27  0:31     ` Thompson, David
2015-10-27 17:46       ` Ludovic Courtès
2015-07-07 13:14 ` [PATCH 01/15] build: syscalls: Add additional mount flags Ludovic Courtès
2015-07-07 22:42   ` Thompson, David

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

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

  git send-email \
    --in-reply-to=87a8rpyzb9.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=davet@gnu.org \
    --cc=dthompson2@worcester.edu \
    --cc=guix-devel@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.