[Nix-dev] Let's switch the default shell in Nixpks / NixOS to csh

deCube.net | Danny Wilson danny at decube.net
Wed Apr 1 23:31:52 CEST 2015


It shouldn’t be difficult, if only...

While adding support for SmartOS I’ve encountered many  “autoconf” packages that claim to be shell agnostic, yet are riddled with BASH-isms. SmartOS comes with KSH installed in /bin/sh by default, that’s how I noticed.

In order to make some progress and not have to patch pretty much every package, I ended up forcibly replacing the #!/bin/sh shebang on every script before buidling:  https://github.com/vizanto/nixpkgs/commit/152344c19aa1f8839fc3360eef826d803901a2f8


Best regards,
Danny

 
On 1 apr. 2015, at 23:26, Peter Simons <simons at cryp.to> wrote:

> Hi guys,
> 
> the default builder in Nixpkgs (and pretty much all other shell code in all our
> packages) assumes that it's interpreted by "bash". Now, we've had a lot of
> trouble with "bash" recently:
> 
> - crazy security vulnerabilities;
> 
> - auto completion is slow, gives unexpected results, or doesn't work at all;
> 
> - /bin/sh is not "bash" on many non-NixOS host systems; and
> 
> - many of other problems.
> 
> This makes me wonder whether maybe we should switch all shell scripting in
> Nixpkgs to "csh"? Wouldn't that solve a lot of problems? I've heard experts say
> that "csh" is generally considered superior for scripting tasks because of its
> more intuitive syntax.
> 
> Now, the only minor obstacle is to transition the existing package base from
> "bash" to "csh". That wouldn't be difficult to accomplish, though. There's
> probably a bash2csh converter available somewhere that we could use.
> 
> Of course, for consistency's sake we'd have to make "csh" the only supported
> user shell for accounts on NixOS machines too. We don't want our users messing
> with other shells. All that diversity will just make our lives harder as
> developers. These people will drive us crazy with bug reports on Github,
> complaining about how they freaky "bash" environment no longer works with
> "nix-shell" etc., and that's just going to be a maintenance nightmare. It's
> probably better to decide once and for all that Nix supports only "csh" and
> move on to other, more important things.
> 
> Anyway, let me know that you think. Shall I prepare a pull request?
> 
> Best regards,
> Peter
> 
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev



More information about the nix-dev mailing list