-
Notifications
You must be signed in to change notification settings - Fork 697
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
Improving Cabal Solver Output for Better Readability and Usability #8939
Comments
God speed! We'll be sure to review and accept in timely manner! |
@yvan-sraka 👏 thank you for reopening this discussion. I wonder how we are going to visualise the backtracking though. In your example situation:
IIRC the solver would backtrack on the ouroboros-network-testing-0.2.0.1 choice and try other versions. Only if it cannot find any working solution it would fail. But I don't see it doing that backtracking in the output you copied above 🤔 |
Yes, the solver would need to consider all versions of each package before failing. Unfortunately, cabal only prints the first conflicts by default. These conflicts show why cabal couldn't use the most preferred versions, but not why it failed overall. -v3 shows all of the backtracking. I think it would be great to show the full log in cases where there are very few conflicting packages and the log is relatively short. Issues #5647 and #4251 relate to simplifying the output. |
Indeed! My current thought is to follow the proposal made by @chshersh in #8475. This approach provides a visualization of the backtracking in an easy-to-parse-with-eye manner:
However, I acknowledge, as mentioned by @Mikolaj in the original RFC, that this visualization isn't universally clear. It may need further tweaking, improvement, or documentation. I must say, I'm fond of the “skipping 32 other versions” heuristic, but maybe it lacks explicit instruction for verbose output, like a
I understand from the conversation in the linked issues that a more useful solver output is already available (with Could we consider a scenario where cabal fails quickly with a minimal message (potentially without any solver output), but encourages the user to rerun the command with a, e.g., To clarify, my underlying suggestion is that, for a better developer experience, we might prefer no solver output and a clear error message that encourages the user to seek a comprehensive solver output diagnostic. This approach could be preferable to having a confusing output by default, which may mislead a user who may not instinctively use the correct diagnostic flags to debug their issue. What are your thoughts on this? |
I think that adding a flag to show high quality output from the solver (and minimal output otherwise) makes sense if the output is expensive to generate. However, I think that the
|
Related: the "(constraint from minimum version of Cabal used by Setup.hs requires >=3.8)" part of the error message in #9294 could also use some improvement (it comes from an extra restriction on Custom setup scripts, see the ticket). |
Hi everyone, Since quite a while has passed since I posted this RFC, and my approach has somewhat diverged from the original plan. Here's an update on what has been done, what I'm currently working on (which may need reviews), and what remains to be done:
So, what's the next step? I'm focusing on completing #9465 and experimenting with external tools to which I could pipe a mechanized (JSON) alternative solver log output. The rationale behind this is that changing the display of solver logs without altering the (sensitive) solver logic itself is hard. While verbose logs of the solver help in understanding its backtracking algorithm, they are not suitable as default output for standard users... The best approach, IMHO, is to dynamically display it, mimicking what @marlorn's |
Hello everyone,
At IOG, we have repeatedly faced issues with the Cabal solver output, as recently mentioned by @angerman. We lose valuable time trying to locate crucial information that should be more prominently displayed.
Problem
Consider the following trace:
We need to look closely to identify the real issue:
Proposed Solution
I suggest enhancing the solver output to be more readable and easier to parse, this has been already proposed:
One improvement to this proposal would be to mark the latest known version of a package to the solver, as described here:
This would overall contribute to a better user experience. WDYT?
Related Issues
Implementing this proposal would also be an opportunity to address:
+nowrap
#5488Further enhancements could be made by addressing:
--dump-dot-install-plan <outfile>
incabal install
#2728In summary, we believe that enhancing the Cabal solver output will significantly improve the user experience and save developers time. I plan to implement most of these features in a fork next weeks and hope to got inputs from the community 🙂
The text was updated successfully, but these errors were encountered: