Collapse resolver incompatiblities for workspace members#6090
Closed
Collapse resolver incompatiblities for workspace members#6090
Conversation
zanieb
commented
Aug 14, 2024
| } | ||
| } | ||
|
|
||
| fn iter_tree( |
Member
Author
There was a problem hiding this comment.
This is a display utility, need to find a home for it.
Member
Author
|
These commits are being used in #6092 |
zanieb
added a commit
that referenced
this pull request
Aug 15, 2024
An extension of #6090 that replaces #6066. In brief, 1. Workspace member names are passed to the resolver for no solution errors 2. There is a new derivation tree pre-processing step that trims `NoVersion` incompatibilities for workspace members from the derivation tree. This avoids showing redundant clauses like `Because only bird==0.1.0 is available and bird==0.1.0 depends on anyio==4.3.0, we can conclude that all versions of bird depend on anyio==4.3.0.`. As a minor note, we use a custom incompatibility kind to mark these incompatibilities at resolution-time instead of afterwards. 3. Root dependencies on workspace members say `your workspace requires bird` rather than `you require bird` 4. Workspace member package display omits the version, e.g., `bird` instead of `bird==0.1.0` 5. Instead of reporting a workspace member as unusable we note that its requirements cannot be solved, e.g., `bird's requirements are unsatisfiable` instead of `bird cannot be used`. 6. Instead of saying `your requirements are unsatisfiable` we say `your workspace's requirements are unsatisfiable` when in a workspace, since we're not in a "provide direct requirements" paradigm. As an annoying but minor implementation detail, `PackageRange` now requires access to the `PubGrubReportFormatter` so it can determine if it is formatting a workspace member or not. We could probably improve the abstractions in the future. As a follow-up, we should additional special casing for "single project" workspaces to avoid mention of the workspace concept in simple projects. However, it looks like this will require additional tree manipulations so I'm going to keep it separate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #6066
Transforms the derivation tree to exclude "no versions" incompatibilities for workspace members so we don't say things like (where
birdis a workspace member):Instead, we say:
There's more to be done, more in the flavor of #6066 where we add custom handling for workspace members in the formatter to avoid saying things like "all versions of bird" (which doesn't make sense, because there's only the one local version) and "you require bird" (which could be clearer, i.e., "the workspace includes bird").
Note that 0403e80 isn't actually necessary for this change. I may drop it and just match on
NoVersionsdirectly. I'm not sure of the long-term trade-offs here.