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

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

Open
FilipToth opened this issue Oct 14, 2024 · 0 comments
Open

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

FilipToth opened this issue Oct 14, 2024 · 0 comments

Comments

@FilipToth
Copy link

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.

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

No branches or pull requests

1 participant