[Nix-dev] Down with /bin/sh!

Ludovic Courtès ludo at gnu.org
Thu Jan 3 17:27:28 CET 2013


Hi Rob!

Rob Vermaas <rob.vermaas at gmail.com> skribis:

>   • Right after unpacking a source tarball, all the source files go
>>     through ‘patch-shebang’, which replaces any #!/bin/sh and similar
>>     with the right path.
>>
>
> I would not like such a change in stdenv of nixpkgs, without an option to
> disable this. For example, we use nix to build some packages that run
> outside of nix, and for those, we do not want to replace all the references
> to /bin/sh in all source files/scripts.

I’m not sure what you mean by “run outside of Nix”.

The files that are patched are source files anyway.  Nixpkgs already has
a patch-shebang phase for installed files, which is what users notice.

> I haven't thought of it much, but in general I would like an approach
> better that would *not* change the source code of packages by default,
> but only when it is really necessary.

Well yeah, it’s a bit of a sledgehammer approach.  Still, it works
like a charm, and feels just like a natural extension of all our
craziness.  :-)

Thanks,
Ludo’.


More information about the nix-dev mailing list