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

Locking Cargo.lock fails with ENOSYS (Linux, Android) #10972

Closed
theCapypara opened this issue Aug 11, 2022 · 1 comment · Fixed by #10975
Closed

Locking Cargo.lock fails with ENOSYS (Linux, Android) #10972

theCapypara opened this issue Aug 11, 2022 · 1 comment · Fixed by #10975
Labels
C-bug Category: bug O-android OS: Android

Comments

@theCapypara
Copy link
Contributor

Problem

Running cargo build or similiar commands fails with:

error: failed to lock file: /path/Cargo.lock

Caused by:
  Function not implemented (os error 38)

rustc version:

rustc 1.62.1
binary: rustc
commit-hash: unknown
commit-date: unknown
host: aarch64-linux-android
release: 1.62.1
LLVM version: 14.0.6

Steps

  1. Have Rust installed on Android via Termux (aarch64-linux-android)
  2. Run cargo build inside a project

Possible Solution(s)

No response

Notes

This is very odd, since the code (https://github.com/rust-lang/cargo/blame/master/src/cargo/util/flock.rs#L382) should check for this case and not fail. I am very unsure why it's still failing.

Version

cargo 1.62.1
release: 1.62.1
host: aarch64-linux-android
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:OpenSSL/3.0.0c)
os: Android [unknown bitness]
@theCapypara theCapypara added the C-bug Category: bug label Aug 11, 2022
@theCapypara
Copy link
Contributor Author

theCapypara commented Aug 11, 2022

I'm pretty sure the issue is that on Android target_os is "android", not "linux". Can anybody confirm this? Or is this distribution of Rust somehow using an incorrect value for target_os?

rustc --print cfg
debug_assertions
panic="unwind"
target_arch="aarch64"
target_endian="little"
target_env=""
target_family="unix"
target_feature="neon"
target_feature="pmuv3"
target_has_atomic="128"
target_has_atomic="16"
target_has_atomic="32"
target_has_atomic="64"
target_has_atomic="8"
target_has_atomic="ptr"
target_os="android"
target_pointer_width="64"
target_vendor="unknown"
unix

Edit: I confirmed this on an "ordinary" PC with Rust managed by rustup, and it's still "android", so I guess this has to be a bug in Cargo then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug O-android OS: Android
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants