-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Stack overflow on virtual project with patched dependencies which point at each other #7163
Comments
I've narrowed this down to a test case: #[cargo_test]
fn cycle() {
Package::new("a", "1.0.0").publish();
Package::new("b", "1.0.0").publish();
let p = project()
.file("Cargo.toml",
r#"
[workspace]
members = ["a", "b"]
[patch.crates-io]
a = {path="a"}
b = {path="b"}
"#)
.file("a/Cargo.toml",
r#"
[package]
name = "a"
version = "1.0.0"
[dependencies]
b = "1.0"
"#)
.file("a/src/lib.rs", "")
.file("b/Cargo.toml",
r#"
[package]
name = "b"
version = "1.0.0"
[dependencies]
a = "1.0"
"#)
.file("b/src/lib.rs", "")
.build();
p.cargo("check").run();
} This gets caught in a cycle in @Eh2406 or @alexcrichton, I could have sworn the resolver had some cycle detection, but it doesn't seem to trigger in this case with EDIT: The |
Thanks @ehuss, I have not looked into this yet but here are some links. |
Well, i understand what needs to be done to resolve this for me and what is wrong in project layout. But yeah, not giving a proper error is definitely user friendly 😸 |
@handicraftsman You can't have a cycle in your dependency graph. You'll need to restructure so that auragfx and auragfx-backend-glutin don't depend on one another. |
Yeah, already noticed that as i've said above. Already done. |
Oh, haha, I misread. 😄 |
I believe the bug is this line which returns a false negative for |
This commit fixes detection of cyclic dependencies through the use of `[patch]` by ensuring that `matches_id` isn't used because it returns a false negative for registry dependencies when the dependency specifications don't match but the resolve edges are still correct. Closes rust-lang#7163
Fix detection of cyclic dependencies through `[patch]` This commit fixes detection of cyclic dependencies through the use of `[patch]` by ensuring that `matches_id` isn't used because it returns a false negative for registry dependencies when the dependency specifications don't match but the resolve edges are still correct. Closes #7163
Literally this
Steps
[workspace]
section and[patch.crates-io]
sectionNotes
Output of
cargo version
:The text was updated successfully, but these errors were encountered: