From 3967b75ae4a10d0d79560dfecb8eb210aad4f4f2 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 6 Mar 2025 20:07:30 +0100 Subject: solver3: Verbose error messages Introduce a new function, LongWhyStr() that returns a longer reason for why something is being installed (or not). This does the same path walk as the other function does, but it renders the clauses at each level, and one per line, so the whole output is a lot more informative. It is a separate function to keep the existing debug messages use the simple single line implication graph We remove the other special case in AddWork() for empty solutions to mke use of the general case in Solve() instead, and then adapt the case in Solve() to the same case as in Enqueue(). This also happens to fix the bug that when we encountered an empty clause we just printed the clause had no solution, but not how we got to install the package with the clause. Adapt the test suite for the changes which is an annoying amount of paperwork. --- test/integration/test-multiarch-foreign | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'test/integration/test-multiarch-foreign') diff --git a/test/integration/test-multiarch-foreign b/test/integration/test-multiarch-foreign index 5a7b1a3b7..a04b854a5 100755 --- a/test/integration/test-multiarch-foreign +++ b/test/integration/test-multiarch-foreign @@ -179,14 +179,23 @@ distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: ' - testfailuremsg "E: Conflict: ${1%:*}:$4=1.0 -> not hates-foo:amd64 but hates-foo:amd64=1.0 -> hates-foo:amd64" aptget install $1 hates-foo -s --solver 3.0 + testfailuremsg "E: Unable to satisfy dependencies. Reached two conflicting decisions: + 1. hates-foo:amd64=1.0 is selected for install + 2. hates-foo:amd64 is not selected for install because: + 1. ${1%:*}:$4=1.0 is selected for install + 2. hates-foo:amd64 Conflicts foo + [selected ${1%:*}:$4=1.0]" aptget install $1 hates-foo -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: hates-foo : Conflicts: foo Conflicts: foo:i386 Conflicts: foo:armel E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo -s --solver internal - testfailuremsg "E: Conflict: $2:amd64=1.0 -> $2:amd64 -> not foo:$4=1.0 but foo:$4=1.0" aptget install $1 $2 -s --solver 3.0 + testfailuremsg "E: Unable to satisfy dependencies. Reached two conflicting decisions: + 1. foo:$4=1.0 is selected for install + 2. foo:$4=1.0 is not selected for install because: + 1. $2:amd64=1.0 is selected for install + 2. $2:amd64 Conflicts foo:$4" aptget install $1 $2 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: $2 : Conflicts: foo:$4 -- cgit v1.2.3-70-g09d2