Skip to content

Commit

Permalink
fix: std Cargo.lock moved to library dir
Browse files Browse the repository at this point in the history
rust-lang#14358 didn't check the correct Cargo.lock existence
Perhaps it was there so the test passed, but after a new nightly
is out it is gone.

```
    Blocking waiting for file lock on package cache
error: "/home/user/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try:
        rustup component add rust-src --toolchain nightly-aarch64-apple-darwin

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrac
```
  • Loading branch information
weihanglo committed Aug 8, 2024
1 parent f50c592 commit d044052
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cargo/core/compiler/standard_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn resolve_std<'gctx>(
}

let src_path = detect_sysroot_src_path(target_data)?;
let std_ws_manifest_path = src_path.join("library").join("Cargo.toml");
let std_ws_manifest_path = src_path.join("Cargo.toml");
let gctx = ws.gctx();
// TODO: Consider doing something to enforce --locked? Or to prevent the
// lock file from being written, such as setting ephemeral.
Expand Down Expand Up @@ -192,7 +192,8 @@ fn detect_sysroot_src_path(target_data: &RustcTargetData<'_>) -> CargoResult<Pat
.join("lib")
.join("rustlib")
.join("src")
.join("rust");
.join("rust")
.join("library");
let lock = src_path.join("Cargo.lock");
if !lock.exists() {
let msg = format!(
Expand Down

0 comments on commit d044052

Please sign in to comment.