And I’ve been running nix-build -E 'with import <nixpkgs> {}; callPackage ./default.nix {}' to build things.
But I keep getting some confusing errors that seem to imply things like rm and cat are missing:
> nix-build -E 'with import <nixpkgs> {}; callPackage ./default.nix {}'
this derivation will be built:
/nix/store/gahinm75sjmf6z2g3z9vz8kq1q2dq1pl-cobalt.drv
building '/nix/store/gahinm75sjmf6z2g3z9vz8kq1q2dq1pl-cobalt.drv'...
unpacking sources
unpacking source archive /nix/store/5z0qmkxz2nhqqidvvqcrhz0b0zl80mls-source
source root is source
patching sources
configuring
./scripts/common/impl/get_lock.sh: line 14: whoami: not found
Waiting for /build/source/c++/configure.lock./scripts/common/impl/get_lock.sh: line 84: sleep: not found
../scripts/common/impl/get_lock.sh: line 22: expr: not found
sh: out of range
./scripts/common/impl/get_lock.sh: line 19: rm: not found
./scripts/common/impl/get_lock.sh: line 89: cat: not found
./scripts/common/impl/get_lock.sh: line 89: cat: not found
./scripts/common/impl/get_lock.sh: line 89: cat: not found
./scripts/common/impl/get_lock.sh: line 89: cat: not found
./scripts/common/impl/get_lock.sh: line 96: fmt: not found
error: builder for '/nix/store/gahinm75sjmf6z2g3z9vz8kq1q2dq1pl-cobalt.drv' failed with exit code 1;
last 10 log lines:
> ./scripts/common/impl/get_lock.sh: line 14: whoami: not found
> Waiting for /build/source/c++/configure.lock./scripts/common/impl/get_lock.sh: line 84: sleep: not found
> ../scripts/common/impl/get_lock.sh: line 22: expr: not found
> sh: out of range
> ./scripts/common/impl/get_lock.sh: line 19: rm: not found
> ./scripts/common/impl/get_lock.sh: line 89: cat: not found
> ./scripts/common/impl/get_lock.sh: line 89: cat: not found
> ./scripts/common/impl/get_lock.sh: line 89: cat: not found
> ./scripts/common/impl/get_lock.sh: line 89: cat: not found
> ./scripts/common/impl/get_lock.sh: line 96: fmt: not found
Absolutely no idea what’s going on here since I can use rm and cat just fine in fields like configurePhase…
I’d look at the configure script and along its path to ./scripts/common/impl/get_lock.sh.
If I had to guess, something along that chain is trying to do some kind of PATH sanity-checking like setting a bog-standard unix PATH (maybe imperatively, or maybe just if it doesn’t detect “normal” locations in the PATH).
Yeah, it’s looking like a bit of a disaster so far… Any tips for patching / links to good places to learn? Are there any Nix specifics or should prePatch and some find / sed do the trick?
Thanks so much for helping me find the PATH issues!
Additionally, as a backup plan if this proves more difficult than some patching (as I’m now getting totally new errors that pop up after all of the path stuff I think is patched out), is it possible to use buildFHSUserEnv to build something like this?
I was trying something like:
buildFHSUserEnv {
name = "COBALT";
targetPkgs = pkgs: [ gcc9Stdenv wget ];
extraInstallCommands = ''
wget ftp.ncbi.nlm.nih.gov/pub/cobalt/executables/${version}/ncbi-cobalt-${version}-src.tar.gz
cd c++
./configure
make
'';
runScript = "bash";
But it can’t seem to find wget?
Here is the whole disaster I have right now which I might leave here while I head to bed if anyone fancies a challenge…