Skip to content

Add error reporting for the new version solver #1785

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

Merged
merged 10 commits into from
Feb 6, 2018

Conversation

nex3
Copy link
Member

@nex3 nex3 commented Jan 19, 2018

No description provided.

nex3 added 6 commits January 18, 2018 16:22
This improves some complex error output
This is useful for formatting human-readable error messages.
This was just the root package's directory, which is always the
current working directory anyway.
This makes it possible to produce terse output by default while also
providing enough detail to diagnose incompatible sources or
descriptions.
@kevmoo
Copy link
Member

kevmoo commented Jan 19, 2018

A thought (for my contrived case)

Because repo_manager depends on angular 5.0.0-alpha+4 which depends on quiver >=0.22.0 <0.28.0, quiver >=0.22.0 <0.28.0 is required.
So, because repo_manager depends on quiver ^0.21.0, version solving failed.

My attempt at tweaks...

repo_manager depends on angular 5.0.0-alpha+4 which depends on quiver >=0.22.0 <0.28.0
  so quiver >=0.22.0 <0.28.0 is required.
but, repo_manager also depends on quiver ^0.21.0, with is incompatible with quiver >=0.22.0 <0.28.0
so version solving failed.

This is 1000x than what we have now. Feel free to tuck this away as a p2 for later.

@nex3
Copy link
Member Author

nex3 commented Jan 19, 2018

@kevmoo What would your proposed output do if the terminal was too narrow to fit the entire first line?

repo_manager also depends on quiver ^0.21.0, with is incompatible with quiver >=0.22.0 <0.28.0

My instinct is that including this level of explanation at every step would make the output in even moderately complex cases a lot more verbose. There comes a point at which explicitness is actually unhelpful because there's so much raw text that peoples eyes gloss over. Is this worth it?

@nex3 nex3 force-pushed the feature.solver.error branch from f440189 to d4842cd Compare January 19, 2018 00:52
Copy link
Member

@munificent munificent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests?

///
/// See https://github.com/dart-lang/pub/tree/master/doc/solver.md#error-reporting
/// for details on how this algorithm works.
String toString() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is quite the method! Given that it has state and a number of sub-functions with their own doc comments, I think it's worth moving it out to a separate class that this calls.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

/// If [incompatibility] is only used to derive one other incompatibility,
/// it may make sense to skip that derivation and just derive the second
/// incompatibility directly from three causes. This is usually clear enough
/// to the user, and makes the proof much terser.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give an example? (If that's not easy, feel free to ignore this.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member Author

@nex3 nex3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests?

Coming in the next PR. This behavior is mostly covered by the existing failure tests, but I didn't want to add to an already large change by triaging all the tests and migrating them to the new output format.

///
/// See https://github.com/dart-lang/pub/tree/master/doc/solver.md#error-reporting
/// for details on how this algorithm works.
String toString() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

/// If [incompatibility] is only used to derive one other incompatibility,
/// it may make sense to skip that derivation and just derive the second
/// incompatibility directly from three causes. This is usually clear enough
/// to the user, and makes the proof much terser.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@nex3 nex3 force-pushed the feature.solver.error branch from cb2f508 to 8c27f03 Compare February 6, 2018 00:32
@nex3 nex3 merged commit 31f171e into feature.solver Feb 6, 2018
@nex3 nex3 deleted the feature.solver.error branch February 6, 2018 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants