Improve resolver error messages referencing workspace members#6066
Closed
Improve resolver error messages referencing workspace members#6066
Conversation
Member
Author
|
Some clear improvements here, but I'm disappointed there's basically no coverage for resolution failures involving workspace members — we'll need to add a bunch more test coverage before this can be merged with confidence. |
a8bd588 to
83a5549
Compare
zanieb
added a commit
that referenced
this pull request
Aug 14, 2024
Adding some test cases to help inform the work in #6066
This was referenced Aug 14, 2024
Member
Author
|
Closing in favor of #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.
No description provided.