-
Notifications
You must be signed in to change notification settings - Fork 38
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
Root package version should be optional #150
Comments
Thank you for trying PubGrub! I appreciate the production feedback. I am just giving first reactions here. I may disagree with the opinion stated upon further reflection or the arrival of evidence.
Reading over your statement again and my response, I may be responding to "my repackage doesn't have a name" not "my repackage doesn't have a version". If I have misunderstood and the two topics are not deeply intertwined, my responses may be entirely irrelevant. |
Thanks for the response!
The greater problem is that the version of https://github.com/zanieb/pubgrub/blob/zanie/examples/examples/unsat_root_message_no_version.rs |
The error reporting is probably the part of this lib that received the less love. It's not much optimized, performance-wise and there could be much better ways saying what the errors are while reading the derivation tree. It really is a minimal viable error reporting. The structure used for error reporting is a derivation tree, roughly presented here: https://pubgrub-rs-guide.netlify.app/pubgrub_crate/custom_report. We haven't tried implementing easy way to extend the default reporter as frankly, it was a minimum effort reporter and I didn't expect to live until now. Regarding the "root" name, I agree it's very weird to have it presented like that in the reports. In your example :
it would make much more sense if the report said instead something like this:
I don't know how much of a better minimal version reporter we could make by "just" updating it a bit. Or if it needs a full rewrite ... Regarding the version associated with root package. It's because the solver can be used to solve both projects and package roots. And for a package root it's nice to have it's version displayed too. We didn't make a distinction in the reporter. |
Thanks for the additional context.
I agree this would be ideal. The existing error messages are unfortunately insufficient for our use-case and thus it is my highest priority to determine if we can reach a more user-friendly state. It sounds like I should attempt to write a new reporter that is specifically for "projects". |
While looking over the changes you had to make I got to wondering. Should you have an enum for version? Where the display of the I completely agree that we should provide a more flexible reporter, but in the meantime I wonder if that would help. |
Hm interesting I hadn't considered that. Then we'd end often up with an extra space since the formatting is |
Example at https://github.com/zanieb/pubgrub/blob/zanie/examples/examples/unsat_root_messages.rs
In practice, the root package often does not have a real or known version number. To get around this, we just use a dummy minimum version for the root package but then the version appears in messaging e.g.
To resolve this, a PubGrub user must:
Package
type with "root" and "not root" variantsDisplay
trait forExternal
which requires copying the entireReporter
implementationIdeally the root package version would be optional entirely or it would be an option to omit it from the report.
The text was updated successfully, but these errors were encountered: