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

Parsing of workspace members paths broken on Windows #360

Closed
stevenlr opened this issue Feb 3, 2021 · 2 comments
Closed

Parsing of workspace members paths broken on Windows #360

stevenlr opened this issue Feb 3, 2021 · 2 comments

Comments

@stevenlr
Copy link

stevenlr commented Feb 3, 2021

I tried upgrading my project from 0.6.1 to 0.9.1 but ran into an issue:

Error: The regex pattern `.+\(path\+file://(.+)\)` found a path that did not contain a Cargo.toml file: `/C:/Users/steve/Desktop/Callisto`

From what I've seen, this is caused by the fact that cargo metadata has an extra slash than what is expected by the regex (at least on Windows) .

Result of cargo metadata

//...
    "workspace_members": [
        "compile_with_bazel 0.0.0 (path+file:///C:/Users/steve/Desktop/Callisto)"
    ],
//...

From impl/src/metadata.rs:

let crate_member_id_re = Regex::new(r".+\(path\+file://(.+)\)")?;

Since the following code simply appends Cargo.toml to the capture of this regex and checks for the existence of this file, the erronous path (/C:/Users/steve/Desktop/Callisto/Cargo.toml) is generated, and the file cannot be found at this location.

@RexMagi
Copy link
Contributor

RexMagi commented Mar 18, 2021

Hey, I just submitted a PR for this I have also been seeing this issue.
A good workaround I have been successful with has been to use WSL instead of running it directly in windows. it looks like there might be some other bugs in windows though.

@stevenlr
Copy link
Author

Thank you, I just tested it and it's ok now. I'm closing this.

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

2 participants