When I try to do a manual source install of some software on NixOS 15.09, I get (sh -x
is to get an exec log):
[nix-shell:/tmp/nix-shell-es/EventStore-oss-v3.5.0-src]$ sh -x scripts/build-js1/build-js1-linux.sh werror=no ... + CXXFLAGS=-fPIC + make x64.release werror=no PYTHONPATH="/tmp/nix-shell-es/EventStore-oss-v3.5.0-src/scripts/build-js1/v8/tools/generate_shim_headers:" GYP_GENERATORS=make build/gyp/gyp --generator-output="out" build/all.gyp -Ibuild/standalone.gypi --depth=. -Dv8_target_arch=x64 -Dv8_optimized_debug=0 -S.x64.release -Dv8_enable_backtrace=1 -Dwerror='' -Darm_fpu=default -Darm_float_abi=default /bin/sh: build/gyp/gyp: /bin/bash: bad interpreter: No such file or directory Makefile:389: recipe for target 'out/Makefile.x64.release' failed make: *** [out/Makefile.x64.release] Error 126
And indeed there is no bash program in /bin/
[nix-shell:/tmp/nix-shell-es/EventStore-oss-v3.5.0-src]$ ls -la /bin/ total 12 drwxr-xr-x 2 root root 4096 Feb 24 12:25 . drwxr-xr-x 18 root root 4096 Feb 24 12:16 .. lrwxrwxrwx 1 root root 63 Feb 24 12:25 sh -> /nix/store/l80ddf18bbig2icv6cmgjfws9a2vm3jj-bash-4.3-p42/bin/sh
However when I inspect the script I dont see any mention of it so it must be some subprogram looking for it.
As an aside, I imagine that’s probably why the script wisely starts with #!/usr/bin/env bash
and not the direct location of bash.
Anyone knows a blessed way to deal with this ?
Advertisement
Answer
one has to run patchShebangs ./scripts/build-js1/build-js1-linux.sh
on files coming from source when they are not in the store and we want to execute them.