-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add an UnusableDependencies incompatibility kind and use for conflicting versions
#424
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
Changes from 1 commit
8e4f468
ada2226
8058ae8
465ab74
5535a54
dccc87f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,8 @@ pub enum External<P: Package, VS: VersionSet> { | |
| NoVersions(P, VS), | ||
| /// Dependencies of the package are unavailable for versions in that set. | ||
| UnavailableDependencies(P, VS), | ||
| /// Dependencies of the package are unusable for versions in that set. | ||
| UnusableDependencies(P, VS, Option<String>), | ||
| /// Incompatibility coming from the dependencies of a given package. | ||
| FromDependencyOf(P, VS, P, VS), | ||
| } | ||
|
|
@@ -113,6 +115,13 @@ impl<P: Package, VS: VersionSet> DerivationTree<P, VS> { | |
| DerivationTree::External(External::UnavailableDependencies(_, r)) => Some( | ||
| DerivationTree::External(External::UnavailableDependencies(package, set.union(&r))), | ||
| ), | ||
| DerivationTree::External(External::UnusableDependencies(_, r, reason)) => { | ||
| Some(DerivationTree::External(External::UnusableDependencies( | ||
| package, | ||
| set.union(&r), | ||
| reason, | ||
|
||
| ))) | ||
| } | ||
| DerivationTree::External(External::FromDependencyOf(p1, r1, p2, r2)) => { | ||
| if p1 == package { | ||
| Some(DerivationTree::External(External::FromDependencyOf( | ||
|
|
@@ -158,6 +167,29 @@ impl<P: Package, VS: VersionSet> fmt::Display for External<P, VS> { | |
| ) | ||
| } | ||
| } | ||
| Self::UnusableDependencies(package, set, reason) => { | ||
| if let Some(reason) = reason { | ||
| if set == &VS::full() { | ||
| write!(f, "dependencies of {} are unusable: {reason}", package) | ||
| } else { | ||
| write!( | ||
| f, | ||
| "dependencies of {} at version {} are unusable: {reason}", | ||
| package, set | ||
| ) | ||
| } | ||
| } else { | ||
| if set == &VS::full() { | ||
| write!(f, "dependencies of {} are unusable", package) | ||
| } else { | ||
| write!( | ||
| f, | ||
| "dependencies of {} at version {} are unusable", | ||
| package, set | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
||
| Self::FromDependencyOf(p, set_p, dep, set_dep) => { | ||
| if set_p == &VS::full() && set_dep == &VS::full() { | ||
| write!(f, "{} depends on {}", p, dep) | ||
|
|
||
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.
The line breaks here make me read this like a haiku 😂
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.
Me too haha I just kept the existing style but it's funny