[Nix-dev] is there something like unsafeImpureEnvVars?

Ben Franksen ben.franksen at online.de
Wed Apr 16 15:58:39 CEST 2014


Eelco Dolstra wrote:
> On 16/04/14 00:40, Ben Franksen wrote:
>> So everything in my sources is patched to use stuff from /nix/store (I
>> checked that the path exists and is executable) and still it complains
>> about some /bin/sh missing?
> 
> There are many programs that have a (implicit) dependency on /bin/sh.
> Notably, the system() function in Glibc calls /bin/sh. This is why chroots
> on NixOS do include /bin/sh (as well as the dynamic library dependencies
> of /bin/sh).

Note that for this project I am using Nix stand-alone (on Ubuntu), not 
NixOS. I found that /bin/sh is not available by default, so I experimented 
with "build-chroot-dirs = /bin=/nix-bin" (in /etc/nix/nix.conf, copying bash 
from the nix store to /nix-bin/sh). However, that made no difference at all.

It turned out the culprit in this case was make. As soon as I figured this 
out, I could solve the problem by passing "SHELL=sh" to make on the command 
line, so that make uses the sh in the path instead of /bin/sh.

Cheers and many thanks for all the help
Ben
-- 
"Make it so they have to reboot after every typo." -- Scott Adams




More information about the nix-dev mailing list