3

I've got a Rust build script that I need to run for a project that I'm contributing to. Cargo attempts to execute the script before the main build process but fails, so I tried running it:

$ ./build-script-build
bash: ./build-script-build: No such file or directory

However, the file clearly exists:

$ file build-script-build
build-script-build: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld64.so.1, not stripped

And I have permissions:

$ stat -c %A build-script-build
-rwxr-xr-x

strace shows the following:

$ strace ./build-script-build
execve("./build-script-build", ["./build-script-build"], [/* 23 vars */]) = -1 ENOENT (No such file or directory)
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
write(2, "strace: exec: No such file or di"..., 40) = 40
exit_group(1)                           = ?
+++ exited with 1 +++

I know this issue can crop up with 32-bit executables on 64-bit systems, but file shows that it's 64-bit. What am I missing?

This is on Linux 4.8.13-1-ARCH x86_64, by the way.

  • I'm curious: what happens if you 1. run strace with the full path, 2. move and run from another location (e.g., /tmp)? – sage Dec 27 '17 at 17:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.