Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such file or directory (os error 2) #85

Open
joshcangit opened this issue Mar 26, 2023 · 8 comments
Open

No such file or directory (os error 2) #85

joshcangit opened this issue Mar 26, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@joshcangit
Copy link

joshcangit commented Mar 26, 2023

Version 0.23.0 keeps giving me an error whenever I run a script.

error: No such file or directory (os error 2)

Had to use the previous version for it to work.

Version info:

cargo 1.68.1
rustc 1.68.1 (8460ca823 2023-03-20) (built from a source tarball)

Get readelf -p .comment

String dump of section '.comment':
  [     0]  mold 1.11.0 (compatible with GNU ld)
  [    25]  Android (9352603, based on r450784d1) clang version 14.0.7 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0cca074e9238af8b4106c30add4418f6)
@joshcangit
Copy link
Author

However on my PC, it works fine.

String dump of section '.comment':
  [     0]  GCC: (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0
  [    2b]  mold 1.11.0 (cca255e6be069cdbc135c83fd16036d86b98b85e; compatible with GNU ld)

@fornwall fornwall added the bug Something isn't working label Mar 27, 2023
@joshcangit
Copy link
Author

Also to add, Rust is now broken on Termux Android.

termux/termux-packages#15851

After the libllvm package updated from 15.0.7-3 to 16.0.0, the rust package had to be removed.

This was just 2 days after I posted this issue.
I'll try to test this again after Rust is fixed.

@joshcangit
Copy link
Author

joshcangit commented Apr 2, 2023

Nope, 0.23.0 still won't work.
This issue still persists in later versions.

Something changed after 0.22.0 that caused it to stop working.
0.22.0...0.23.0

Tried running with this configuration.

[build]
RUSTFLAGS = ["-Clink-arg=-Wl,-rpath=/data/data/com.termux/files/usr/lib", "-Clink-arg=-Wl,--enable-new-dtags"]

Also won't work.

@tennox
Copy link
Contributor

tennox commented May 16, 2023

Are you installing rust-script via Nix or similar?
I realized that using it via nix this error occurs, but via cargo install it works. 🤔

@joshcangit
Copy link
Author

Are you installing rust-script via Nix or similar?

I'm using the rust package installed by apt in Termux.
No, I didn't install Nix-on-Droid.

@joshcangit
Copy link
Author

Could this be an issue regarding glibc?
Termux uses Bionic libc so if this requires glibc it won't work.

@migel
Copy link

migel commented Jan 6, 2024

I get this error when CARGO_BUILD_TARGET is defined (I use it to compile to musl). The binary is built in the $HOME/.cache/rust-script/binaries/$CARGO_BUILD_TARGET directory and I can run it manually, so probably rust-script is not looking in the correct build directory when cross compiling.

@joshcangit
Copy link
Author

Same here.
I use CARGO_BUILD_TARGET=aarch64-linux-android to get Rust to work on Termux.

Thought it was just rust-script that hard coded pathnames to follow the Linux File System.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants