[Nix-dev] error in unpack-bootstrap-tools.sh

Matei David matei at cs.toronto.edu
Wed Oct 28 17:54:41 CET 2015


On Wed, 28 Oct 2015 12:35:18 -0400
Matei David <matei at cs.toronto.edu> wrote:

> Strangely, now I see one additional error, about "env" not being
> understood:
> 
> Unpacking the bootstrap tools...
> Patching the bootstrap tools...
> /some-dir/nix/store/...-unpack-bootstrap-tools.sh: line 22: env: not
> found
> /some-dir/nix/store/...-unpack-bootstrap-tools.sh:
> line
> 34: /some-dir/nix/store/...-bootstrap-tools/lib/ld-*so.?:
> not found
> 
> This last issue is confusing, because when I try it by hand, env works
> just fine, so I don't know what to make of it.
> 
> $ env -i /some-dir/nix/store/...-busybox ash
> BusyBox v1.22.1 () built-in shell (ash)
> Enter 'help' for a list of built-in commands.
> $ env
> PWD=/some-dir/nix-boot

I think I figured out the issue with env:
1) env is not a busybox command
2) for what I can tell, if busybox is started with an empty
environment, it itself sets PATH to a sensible default. But if PATH is
preset, it doesn't change it:

$ env -i /some-dir/nix/store/...-busybox ash -e <(echo 'echo $PATH')
/sbin:/usr/sbin:/bin:/usr/bin
$ env -i PATH=/nowhere /some-dir/nix/store/...-busybox ash -e <(echo
'echo $PATH')
/nowhere

So before:
- during the nix install PATH is set to PATH='/path-not-set' (as seen
  in the debug output), so env doesn't exist
- when I was trying it by hand with "env -i", PATH would be set to the
  default.


This only explains why env didn't work during the nix install. The
issue with globbing remains.



More information about the nix-dev mailing list