You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect error messages for non-existing dependencies #941
(Imported from Trac #951, reported by guest on 2012-05-15)
When the build-depends-field contains non-existing packages, cabal-install sometimes does not report that these packages could not be found but complains about other constraints being unsolvable.
The attached cabal-file contains a dependency for a non-existing package called "bogus". This is what I get:
I'm not sure what you would actually expect here. The solver has some freedom in which order to try to resolve the goals. And the problem it reports is the first problem it hits. The presence of the bogus dependency in this case prevents the solver from successfully backtracking. So yes, there's more than one problem in this case, and in general, it's difficult to judge which one's the one you want to hear about.
If you remove the bogus dependency, it will still run into the problem you show above at first, but continue backtracking, and will ultimately find a solution (probably by picking an older version of transformers).
So I agree that this might not be the error message you expect, and I see it as a valid enhancement request. But the error message given isn't "incorrect", and I unfortunately don't see a clear heuristics to apply here.
It's really a question about which error message to choose. If you scan up in your log, you will see another "fail (backjumping ..." line before the one you've just shown. Currently, the solver tries backtracking to a limit, and if it fails, it will print the first error it encountered. This is based on the heuristic that usually, the first choices involve the least compromises, and are most likely to point to the actual problem. In this case, it actually points at a real problem (namely "transformers-3" being incompatible with your package), but that's not the main problem you're interested in.
I do have something in mind that might fix this. I am planning to use the backtracking solver to generate several install plans and pick a "best" one according to heuristics. We could do the same for error messages. However, it's less clear to me how to define heuristics for what constitutes the best among several error messages.
I have an idea for improving the summary in cases like this. We could run the solver once to try to find a solution. Then, if it fails, we could run it again, but have it prefer goals from the first run's top-level conflict set. The solver would use the log from the second run, up to the first error, as the summary.
The errors from the second run could be more relevant, because they are likely to come from the final conflict set, which explains why the whole tree has no solution. In this example, the conflict set is probably {bogus, foo}. So the error message would show the solver trying foo and then bogus.
#5012 should improve the error message in this case. The -v3 message from #941 (comment) shows that the final conflict set contained just bogus and foo, so #5012 should only show the conflict between those two packages.
Activity
bos commentedon May 24, 2012
(Imported comment by @kosmikus on 2012-05-15)
Thanks for the report.
I'm not sure what you would actually expect here. The solver has some freedom in which order to try to resolve the goals. And the problem it reports is the first problem it hits. The presence of the bogus dependency in this case prevents the solver from successfully backtracking. So yes, there's more than one problem in this case, and in general, it's difficult to judge which one's the one you want to hear about.
If you remove the bogus dependency, it will still run into the problem you show above at first, but continue backtracking, and will ultimately find a solution (probably by picking an older version of transformers).
So I agree that this might not be the error message you expect, and I see it as a valid enhancement request. But the error message given isn't "incorrect", and I unfortunately don't see a clear heuristics to apply here.
bos commentedon May 24, 2012
(Imported comment by guest on 2012-05-15)
Thanks for answering!
Sounds complicated. I guess, good error reporting for unsuccessful constraint solving is a big subject in its own right.
BTW: Increased verbosity (-v3) results in a message containing this:
Which is what I would expect from cabal-install without increased verbosity.bos commentedon May 24, 2012
(Imported comment by @kosmikus on 2012-05-15)
It's really a question about which error message to choose. If you scan up in your log, you will see another "fail (backjumping ..." line before the one you've just shown. Currently, the solver tries backtracking to a limit, and if it fails, it will print the first error it encountered. This is based on the heuristic that usually, the first choices involve the least compromises, and are most likely to point to the actual problem. In this case, it actually points at a real problem (namely "transformers-3" being incompatible with your package), but that's not the main problem you're interested in.
I do have something in mind that might fix this. I am planning to use the backtracking solver to generate several install plans and pick a "best" one according to heuristics. We could do the same for error messages. However, it's less clear to me how to define heuristics for what constitutes the best among several error messages.
bos commentedon May 24, 2012
(Imported comment by guest on 2012-05-15)
What about outputting all fails from the solver? Something that would behave similar to
If this is too verbose as the default behavior, it might be good as one verbosity level.sebright commentedon Jul 5, 2016
I have an idea for improving the summary in cases like this. We could run the solver once to try to find a solution. Then, if it fails, we could run it again, but have it prefer goals from the first run's top-level conflict set. The solver would use the log from the second run, up to the first error, as the summary.
The errors from the second run could be more relevant, because they are likely to come from the final conflict set, which explains why the whole tree has no solution. In this example, the conflict set is probably {bogus, foo}. So the error message would show the solver trying
fooand thenbogus.sebright commentedon Dec 4, 2016
See #4139 for another example of a misleading first error message.
Rerun dependency solver to generate a better error message (issue has…
Rerun dependency solver to generate a better error message (issue has…
Rerun dependency solver to generate a better error message (issue has…
Rerun dependency solver to generate a better error message (issue has…
Rerun dependency solver to generate a better error message (issue has…
sebright commentedon Feb 11, 2018
#5012 should improve the error message in this case. The -v3 message from #941 (comment) shows that the final conflict set contained just
bogusandfoo, so #5012 should only show the conflict between those two packages.