-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Unresolvable graphs don't give clear error messages #4322
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
Comments
Oh dear sounds bad! Would it be possible to gist the |
For some background, we're currently building with bazel and use the Cargo.toml/Cargo.lock solely for vendoring. Here is a gist of the Cargo.toml we used. The Cargo.lock is not going to be too useful to you because it has a bunch of our crates in it, but we do have an existing Cargo.lock also checked in, though deleting the Cargo.lock doesn't affect the issue https://gist.github.com/nipunn1313/e7a5569361555d70788ea10c3b8331d8 I played with it a bit more and found that it sometimes takes at least minutes (possibly infinite loop) at 100% CPU. I ran it 10 times and 7/10 times it hung, but the other 3/10 times it finished quickly (around 5 seconds at 100% CPU) with a rather confusing failure. Here's output from one of each
Note that neither the Cargo.toml nor Cargo.lock reference a v0.2.1 of kernel32-sys anywhere |
Perfect! I'm able to reproduce locally, I'll see if I can help debug this in the near future. |
Hm I think that this may actually be a case of #4066 where this is an unresolvable resolution graph which Cargo just takes forever to reject. An example is:
That ends up being un-resolvable because Would it be possible to change |
Yeah I think we can eliminate the = and rely on the Cargo.lock as source of truth for version hardening. I guess we were doing It is pretty disconcerting to have it run 100% CPU effectively indefinitely and occasionally give you a nondetermistic error. We were pretty confused by the error as it was referring to a version of kernel32-sys which we weren't using. I think the output of |
Oh yeah Cargo's error messages on unresolvable resolution graphs are awful right now, and #4066 covers how it takes way too long for Cargo to reach such a conclusion. Definitely both bugs in Cargo! |
Does the problem still reproduce with https://gist.github.com/nipunn1313/e7a5569361555d70788ea10c3b8331d8?
Yes!
Did not take eavan second and clear error message. |
🎉 |
Running
cargo update
is extremely slow on our project (taking minutes).The project totals to 237 crates (including deps)
It looks like
grep package Cargo.lock | wc -l
gives 116.According to top, the cargo process is running at 100% CPU.
I ran perf on it while it's running and got this output
The text was updated successfully, but these errors were encountered: