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

Missing Cargo.lock in nightly, unable to build stdlib #3984

Closed
2 tasks done
dunric opened this issue Aug 8, 2024 · 3 comments
Closed
2 tasks done

Missing Cargo.lock in nightly, unable to build stdlib #3984

dunric opened this issue Aug 8, 2024 · 3 comments
Labels

Comments

@dunric
Copy link

dunric commented Aug 8, 2024

Verification

Problem

Recent nightly toolchain package for x86_64-unknown-linux-gnu platform miss in its rust-src component Cargo.lock file, which rust compiler expects when rebuild of standard library is required.

Steps

  1. Make sure toolchain nightly-x86_64-unknown-linux-gnu is installed with its rust-src component
  2. Attempt to compile a cargo project with build-std option like
    cargo +nightly build -Z build-std=std,panic_abort --target=x86_64-unknown-linux-gnu -r
  3. Compilation fails with

error: "/home/whatever/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try:
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu

rust-src for nightly is indeed installed and subdirectory ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust contains bin/ and library/ from nightly, only Cargo.lock is not there.

Possible Solution(s)

No response

Notes

No response

Rustup version

rustup 1.27.1 (54dd3d00f 2024-04-24)

Installed toolchains

stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu

OS version

Linux x86_64 (Arch Linux)
@dunric dunric added the bug label Aug 8, 2024
@rami3l
Copy link
Member

rami3l commented Aug 8, 2024

@dunric Thanks for filing this issue! I'm not sure if this is a Rustup issue, but it might indicate a faulty installation caused by something like #988. For the moment being, I suggest uninstalling and reinstalling the toolchain in question.

@ChrisDenton
Copy link
Member

This is a Cargo issue and is fixed by rust-lang/cargo#14370

@djc djc closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2024
@dunric
Copy link
Author

dunric commented Aug 8, 2024

This is a Cargo issue and is fixed by rust-lang/cargo#14370

Aha, thanks for the quick reply. Good to know there is already PR which fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants