Skip to content

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

@dunric

Description

@dunric

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions