-
Notifications
You must be signed in to change notification settings - Fork 710
Refactor cabal-install solver config log output #10854
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
base: master
Are you sure you want to change the base?
Conversation
e602461
to
8c1868b
Compare
Any chance you could add examples of what the new output looks like? Say, in the PR description. |
c8f419c
to
5a2528d
Compare
cabal-install-solver/src/Distribution/Solver/Modular/Message.hs
Outdated
Show resolved
Hide resolved
According to this comment this seems like a precursor to #9159 . |
The original change in #9159 was split into a refactoring change and a fix for #4251. Now the refactoring change is in #9159, and the fix for #4251 is in #9541. #9541 contains #9159, because the fix depends on the refactoring. #9560 has also been merged since #9541 was written and helps address #4251. Do you know how this fix compares now? |
5a2528d
to
78733cd
Compare
Current version of this PR aims to minimize the differences in the Still need to provide a information about how this version improves the solver output compared to the current output. |
78733cd
to
b7b0c64
Compare
The changes between the output on This is the only difference I could find in the
New:
I suppose the main benefit of this PR is that in the file |
I have had a look at #9159 (against Update: I am not able find any significant differences between the behavior of the code in this PR and in #9541 . |
b7b0c64
to
6fbd8d7
Compare
Yes, I got confused. This is an updated version of #9541. Ad for #9560, that has been merged but does not seem to be related this PR. I do think that #9159 is related. So the correct comment is, "I am not able find any significant differences between the behavior of the code in this PR and in #9159 ". |
6fbd8d7
to
dce06cb
Compare
Here is the current state of each of the PRs, as I understand it: #9159: It contains two commits (b20ea53 and f10dbcf) that refactor the code in preparation for the improvement to error messages in #9541. Since #9560 was already merged, it seems like the main difference between this PR and master is the refactoring. Are you interested in merging this just for the refactoring? Are you planning to make additional changes to the solver log that depend on it? |
My hope is to get this refactor merged (after the fix suggested by @mpickering ). Then I intend to work on improving error messages as per commit e4775b4 . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I responded to some of your latest comments and changes, but I haven't done another full review yet.
retryMap :: (t -> step) -> RetryLog t fail done -> RetryLog step fail done | ||
retryMap f l = fromProgress $ (\p -> foldProgress (\x xs -> Step (f x) xs) Fail Done p) $ toProgress l |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that it's possible to convert the RetryLogs
s efficiently, but I think that it would be easier to remove the calls to retryMap
, as I described in my previous comment.
cabal-install-solver/src/Distribution/Solver/Modular/Message.hs
Outdated
Show resolved
Hide resolved
It says:
|
Let me try to restart the failing jobs then. It's the same test in all configuration, so this test may be up for the flaky marker if it fails like that ... |
I have left the new fixes for PR comments discrete for easier review. When this is approved for merge I will squash them down as appropriate. |
7f2599e
to
b77ca13
Compare
One of the "Validate" failures is with The "Bootstrap" failure is a failure in Python code and my PR does not touch any Python code. I have already tried rebasing against |
I'll try to patch up the failing test (it's the same one again) today. |
I restarted the bootstrap job, but it failed again in the same way: with |
b77ca13
to
af042db
Compare
I rebased the branch here on the latest master, which contains a fix for the failing test. Please, reset your local branch when you get there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR needs a changelog entry.
Also, the PR description is missing a self-contained description of the change — please add one. I'd expect an example of solver output after this change.
Example solver output is in: #10854 (comment) Solver output has not changed since that. |
af042db
to
e0b480a
Compare
Thank you. I think it should be referenced from or inserted in the PR description. Currently, it's hard to find. So, the new output is longer than the old one. It's the opposite of what most people I talk to want. @Mikolaj @ffaf1 @geekosaur, thoughts? |
The output in that example is actually a rare one. In most cases the differences are really minor as show by the differences requried to make the validate tests pass: 1b701f5 |
I'm confused now. I had thought that we agreed that this PR was just a refactoring change to add an intermediate log message type ( Was the change in #10854 (comment) automatically caught by tests, or did you need to manually compare the solver output? |
I think longer is fine as long as it's more comprehensible. That's the real problem most people have with the current solver output, it's a lot of gobbledygook that requires someone who has some idea of what's going on inside the solver to interpret. |
I fiddled with one of the tests (do not even remember which one) to force a failure. The solver output was obviously different. |
It would help to add a unit test that can detect that change, especially if it's unrelated to the changes caught by the unit tests that had changes to their expected strings. I didn't look at the specific unit test in that comment, but the output from the first one ("master") looks like the summarized log, which is shown at normal verbosity, and the second one ("new") looks like the part of the log that is only shown at higher verbosity (-v3). Did you change the verbosity when running the tests, or is it possible that this PR changes which lines of the solver log are shown at different verbosities? EDIT: I just noticed that the two test runs have different error messages. The first one says "Unexpected error", and the second one says "Unexpected solver log". Is it possible that you forced the failures in two different ways, so that there is only a difference in how the test displayed the solver output? Is the difference reproducible without the test framework? |
4212596
to
39d376e
Compare
The main goal is to add an intermediate log message type to the processing of the solver log. Changes to the cabal solver's output are very minor. Includes: * Apply some of @grayjay and @mpickering comments * Fix haskell#4251 Co-Authored-By: Erik de Castro Lopo <[email protected]>
These fixes are require due to improvements in solver error reporting.
39d376e
to
ef994c5
Compare
Had to rebase this as chasing down changes was becoming too difficult. In the validate test there is now a SINGLE difference: diff --git a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs
index a1f5eed3c6..0136e7cacf 100644
--- a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs
+++ b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs
@@ -208,7 +208,7 @@ tests =
solverSuccess [("base", 1), ("ghc-prim", 1), ("integer-gmp", 1), ("integer-simple", 1)]
, runTest $
mkTest dbNonupgrade "Refuse to install newer ghc requested by another library" ["A"] $
- solverFailure (isInfixOf "rejecting: ghc-2.0.0 (constraint from non-reinstallable package requires installed instance)")
+ solverFailure (isInfixOf "rejecting: ghc-1.0.0/installed-1 (conflict: A => ghc==2.0.0)")
]
, testGroup
"reject-unconstrained" that I have been able to track down. I was not able to find the difference that I found before. I tried subtle modifications to numerous of the validate tests and was comparing the difference between |
🤦 The changes required to remove most of the changes to the validate test expected results causes the doctests to fail. |
@erikd I'm busy for the next few days, but I'll try to do another review in the next week. |
Includes:
This is the PR #9541 rebased and fixed to build.
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significant
in the changelog file.