Sometimes when I try to execute an executable that is not installed by nix, I receive the error:
Failed to execute process '<executable>'. Reason:
The file '<executable>' does not exist or could not be executed.
Unfortunately there is no further information why the executable doesn’t work.
E.g. I got this error now in a node context (installed dependencies by npm):
Failed to execute process '/home/philm/.cache/ms-playwright/chromium-775089/chrome-linux/chrome'. Reason:
The file '/home/philm/.cache/ms-playwright/chromium-775089/chrome-linux/chrome' does not exist or could not be executed.
Is there any way to solve this (e.g. with nix-shell)?
A general solution without nix-shell would be preferred though, as especially in non-pure development context this can get quite tedious. (probably a missing package that is required systemwide?).
Either use an FHA environment in a shell, or try steam-run and it’s friends which basically create a temporary FHS environment.
Alternatively patch the executables interpreter with patchelf, might be tedious or even impossible if the app you have starts them from ephemeral storage and redownload/untars it on every run.
$ file /home/philm/.cache/ms-playwright/chromium-775089/chrome-linux/chrome
/home/philm/.cache/ms-playwright/chromium-775089/chrome-linux/chrome: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, not stripped
I just tried steam-run, and it solves this particular problem (although I got a new problem with refused ws connections, but this is a different story).