-
Notifications
You must be signed in to change notification settings - Fork 767
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
Show full derivation chain when encountering build failures #9108
Conversation
41f35e9
to
651a074
Compare
651a074
to
4561df7
Compare
debb749
to
cf667fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great; a review from @BurntSushi seems prudent since I'm not as familiar with the resolver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the refactor and this seems like an overall great UX improvement too!
pub enum DistRef<'a> { | ||
Built(&'a BuiltDist), | ||
Source(&'a SourceDist), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay ref types.
I don't know if you saw it in my conflicting groups PR, but a useful tip if you ever need to use one of these types for key lookups in hashmaps is to use hashbrown and its Equivalent
trait.
pub fn version(&self) -> Option<&Version> { | ||
match self { | ||
Self::Built(wheel) => Some(wheel.version()), | ||
Self::Source(source_dist) => source_dist.version(), | ||
} | ||
} | ||
|
||
/// Convert this distribution into a reference. | ||
pub fn as_ref(&self) -> DistRef { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting, I thought Clippy didn't like omitting lifetimes like this. e.g., DistRef<'_>
.
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new helper constructors are a nice refactor!
let mut queue = VecDeque::new(); | ||
queue.push_back((target, Vec::new())); | ||
|
||
// TODO(charlie): Consider respecting markers here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without markers, I think this means that you might find the shortest path, but that path might not be possible? Or is there another downside I'm not seeing?
} | ||
} | ||
false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is neat.
"###); | ||
|
||
Ok(()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I missed it, but do you have a test for the case where the failed dependency is not a direct dependency of the root? I was looking for that to see what the error message looks like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also was hoping for a longer chain :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's so annoying to test, but yeah, I definitely need to do it.
18317fb
to
6efd07c
Compare
cf667fc
to
3e30713
Compare
93678b1
to
30691c9
Compare
More Simplify Starting to come together Reverts Trying to get the lock info from sync Rewrite resolution into a graph Add version to ResolvedDist Fix up graphs Attach to install everywhere Attach to install everywhere
3e30713
to
7bb60fa
Compare
Summary
This PR adds context to our error messages to explain why a given package was included, if we fail to download or build it.
It's quite a large change, but it motivated some good refactors and improvements along the way.
Closes #8962.