[Nix-dev] A generic wrapper method (possibly)

phreedom at yandex.ru phreedom at yandex.ru
Tue Dec 3 07:29:11 CET 2013


On Monday, December 02, 2013 09:23:30 AM Eelco Dolstra wrote:

> An alternative that I've been thinking about is to make wrapProgram smarter
> by giving it interpreter-specific backends.  For instance, if the program
> to be wrapped is a shell script, we don't need to generate a wrapper: we
> can just add some lines to be top of the shell script.  Likewise for other
> interpreted languages.  It may even be possible for ELF executables
> (patchelf could override the main() function to do some setenv() calls).

Probably no need for anything interpreter-specific. just call the wrapper via 
shebang. This doesn't really change anything in terms of the number of files 
created or files accessed or files run... just makes it look better 
overall(maybe even obfuscates stuff a bit since you have to dig deeper to see 
the wrapper or even realize that it's present).Interpreter-specific stuff like 
wrapPythonPrograms would stay the same.


More information about the nix-dev mailing list