You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an UnusableDependencies incompatibility kind and use for conflicting versions (#424)
Addresses
#309 (comment)
Similar to #338 this throws an error when merging versions results in an
empty set. Instead of propagating that error, we capture it and return a
new dependency type of `Unusable`. Unusable dependencies are a new
incompatibility kind which includes an arbitrary "reason" string that we
present to the user. Adding a new incompatibility kind requires changes
to the vendored pubgrub crate.
We could use this same incompatibility kind for conflicting urls as in
#284 which should allow the solver to backtrack to another valid version
instead of failing (see #425).
Unlike #383 this does not require changes to PubGrub's package mapping
model. I think in the long run we'll want PubGrub to accept multiple
versions per package to solve this specific issue, but we're interested
in it being merged upstream first. This pull request is just using the
issue as a simple case to explore adding a new incompatibility type.
We may or may not be able convince them to add this new incompatibility
type upstream. As discussed in
pubgrub-rs/pubgrub#152, we may want a more
general incompatibility kind instead which can be used for arbitrary
problems. An upstream pull request has been opened for discussion at
pubgrub-rs/pubgrub#153.
Related to:
- pubgrub-rs/pubgrub#152
- #338
- #383
---------
Co-authored-by: konsti <konstin@mailbox.org>
Copy file name to clipboardExpand all lines: crates/puffin-resolver/src/error.rs
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,9 @@ pub enum ResolveError {
44
44
#[error("Conflicting URLs for package `{0}`: {1} and {2}")]
45
45
ConflictingUrls(PackageName,String,String),
46
46
47
+
#[error("Conflicting versions for `{0}`: {1}")]
48
+
ConflictingVersions(String,String),
49
+
47
50
#[error("Package `{0}` attempted to resolve via URL: {1}. URL dependencies must be expressed as direct requirements or constraints. Consider adding `{0} @ {1}` to your dependencies or constraints file.")]
0 commit comments