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’.