3 ms·
> But then I tried to run it on a build server I was using (Netlify), and I got this extremely strange error message: “File not found”. I straced it, and sure e
by pjc50 7y ago
> But then I tried to run it on a build server I was using (Netlify), and I got this extremely strange error message: “File not found”. I straced it, and sure enough execve was returning the error code ENOENT, which means “File not found”. This was kind of maddening because the file was DEFINITELY there and it had the correct permissions and everything.
This is an infuriating property of the runtime linkers on both Linux and Windows: if you're trying to load file A, and dependency B of file A does not exist, you just get "file not found" with no indication of which file it was, and it's extremely hard to debug. At least on linux the "show dependencies" tool is built in.
- lallysingh 7y agoThere is also LD_DEBUG, which is quite helpful.
- pjmlp 7y agovcdepends used to be part of the SDK as well.
- jwilk 7y agold.so on Linux does show you which library is missing. In this case, it was ld.so itself that was missing, so it didn't have a chance to tell you what's wrong.
- zshift 7y agoI ran into this last week with golang. I’m used to building statically-linked executables, and forgot to set `CGO_ENABLED=0` to force this when compiling. I was doing a multi-stage docker build from `golang:1.13` and copying the final executable to `alpine:3.10`, only to see `shell: main: file not found`. `ls` and just about everything else showed it there. It wasn’t until I rabbit holed into dynamically-linked go executables that it started to make any sense at all. A simple message of `main: linked '/lib64/...' not found` would have saved me hours.
- my123 7y agoOn Windows, you get a graphical dialog in those cases, but no CLI feedback...