cabal2nix - No such file or directory - Nix

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Cyril Valyavin

Hi. I'm having a sudden problem with callCabal2nix on a local package:

cabal2nix: nix-prefetch-url: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

It worked earlier today (and before) and just promptly stopped. Any ideas why could it be? I don't even know where to start looking.
The cabal2nix executable works just fine though.

Torsten Schmits

I would guess that nix-prefetch-url is somehow not in the $PATH…maybe something broke in your env that's calling cabal2nix?

Torsten Schmits

otherwise running the command with strace -f -eopenat <nix command> might show what it's trying to run

Cyril Valyavin

nix-prefetch-url is in $PATH. strace output shows

[pid 10555] openat(AT_FDCWD, "/nix/store/piy9qp1h7mmicxban3sr0wq8na9x5k2z-source", O_RDONLY|O_NOCTTY|O_NONBLOCK) = 3
strace: Process 10556 attached
[pid 10556] +++ exited with 127 +++
[pid 10555] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=4, si_uid=1000, si_status=127, si_utime=0, si_stime=0} ---
cabal2nix: nix-prefetch-url: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

Which I'm not sure how to interpret...

Torsten Schmits

curious. just to be safe: you did include the -f?

Cyril Valyavin

Torsten Schmits said:

curious. just to be safe: you did include the -f?

Yep

Torsten Schmits

oh, maybe try -eopen instead of -eopenat

Cyril Valyavin

Torsten Schmits said:

oh, maybe try -eopen instead of -eopenat

[pid 10802] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 10804 attached
strace: Process 10805 attached
[pid 10805] +++ exited with 127 +++
[pid 10804] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=4, si_uid=1000, si_status=127, si_utime=0, si_stime=0} ---
cabal2nix: nix-prefetch-url: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
[pid 10804] +++ exited with 1 +++
[pid 10802] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3, si_uid=1000, si_status=1, si_utime=0, si_stime=1} ---
[pid 10802] +++ exited with 1 +++
Torsten Schmits

you need to look further up, the target is a line with open that returns something like ENOENT on the rhs of the =!

Torsten Schmits

is your commandline something like nix-shell --pure?

Cyril Valyavin

Torsten Schmits said:

you need to look further up, the target is a line with open that returns something like ENOENT on the rhs of the =!

I don't really see even a single open
Torsten Schmits said:

is your commandline something like nix-shell --pure?

It's just nix-shell. --pure fails in the same way though

Cyril Valyavin

Oh, but with --openat I do see a crap ton of .so files missing

Torsten Schmits

I have experienced problems with files not found by cabal2nix if, for example, the source tree copied to the store was wrong (subdirectory, missing the cabal file). though that doesn't explain that nix-prefetch-url is in the error.

in any case, the store path printed in your first output is worth taking a look at, maybe it's empty

Torsten Schmits

Cyril Valyavin said:

Oh, but with --openat I do see a crap ton of .so files missing

that's normal, it's trying out different locations to find a library. only if they aren't followed by a final success are interesting

Torsten Schmits

with parallel subprocesses, it's possible that it's not the absolute last entry in the output, however

Cyril Valyavin

Torsten Schmits said:

I have experienced problems with files not found by cabal2nix if, for example, the source tree copied to the store was wrong (subdirectory, missing the cabal file). though that doesn't explain that nix-prefetch-url is in the error.

in any case, the store path printed in your first output is worth taking a look at, maybe it's empty

The source file is legit. I should probably try to reinstall Nix altogether

Cyril Valyavin

Didn't work. Well that's weird.

Cyril Valyavin

OH. Case closed, the culprit is me, I called cabal2nix with a file name, not the containing directory!