Skip to content

Cannot find lock-file when building rust-lib sysroot #347

Description

@FilipToth

Xargo fails to build the rust source due to it incorrectly getting a reference to the lockfile for the rust-lib.
Currently, we get the lockfile reference through the following code in sysroot.rs:118:

// rust-src comes with a lockfile for libstd. Use it.
let src_parent = src.path().parent().map(Path::to_path_buf).unwrap_or_else(|| src.path().join(".."));
let lockfile = src_parent.join("Cargo.lock");

From debugging, src_parent points to toolchain-path/lib/rustlib/src/rust/ and not the actual directory where we can find the correct lockfile for rust-lib, which would be: toolchain-path/lib/rustlib/src/rust/library/. Maybe this is just unique to my system. I remember this working a while ago. I have solved this locally by doing something like this:

let lockfile = src.path().join("Cargo.lock");

and fully circumventing the src_parent, since it's not needed anywhere else.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions