[Nix-dev] Dealing with non-Bash /bin/sh on non-NixOS

Eelco Dolstra eelco.dolstra at logicblox.com
Tue Nov 6 12:08:45 CET 2012


Hi,

On 03/11/12 15:24, Ludovic Courtès wrote:

> A common problem for people trying to use Nix/Nixpkgs/Guix on non-NixOS
> distros, especially Debian derivatives, is that their /bin/sh is not
> Bash.  On Debian and derivatives, it’s a symlink to /bin/dash.
> 
> When building without a chroot, things eventually fail because stdenv,
> and sometimes build systems, assume that /bin/sh is Bash.

Where does stdenv assume that /bin/sh is Bash?

> Is there a better way to approach that problem?

Yes, fix builders not to rely on /bin/sh (or at least not to assume it's Bash).
 Certainly any Nix expression that refers to /bin/sh should be fixed to use
${stdenv.shell} (which can be assumed to be Bash).

A workaround would be to implement this feature request:
https://github.com/NixOS/nix/issues/24.  This would allow /bin/sh to be
redirected to whatever you want.

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/


More information about the nix-dev mailing list