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-solver3-alternatives | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 test/integration/test-solver3-alternatives (limited to 'test/integration/test-solver3-alternatives') diff --git a/test/integration/test-solver3-alternatives b/test/integration/test-solver3-alternatives new file mode 100755 index 000000000..8a3645f82 --- /dev/null +++ b/test/integration/test-solver3-alternatives @@ -0,0 +1,32 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +insertpackage 'unstable' 'unsat' 'all' '3' 'Depends: a | b' +insertpackage 'unstable' 'a' 'all' '3' 'Depends: aa|ab' +insertpackage 'unstable' 'b' 'all' '3' 'Depends: ba|bb' +insertpackage 'unstable' 'aa' 'all' '3' 'Depends: aax' +insertpackage 'unstable' 'ab' 'all' '3' 'Depends: abx' +insertpackage 'unstable' 'ba' 'all' '3' 'Depends: bay' +insertpackage 'unstable' 'bb' 'all' '3' 'Depends: bby' +setupaptarchive + +testfailuremsg "E: Unable to satisfy dependencies. Reached two conflicting decisions: + 1. bb:amd64 is selected for install because: + 1. unsat:amd64=3 is selected for install + 2. unsat:amd64 Depends a | b + [selected b:amd64 for install] + 3. b:amd64 Depends ba | bb + [selected b:amd64] + For context, additional choices that could not be installed: + * In unsat:amd64 Depends a | b: + - a:amd64 is not selected for install + * In b:amd64 Depends ba | bb: + - ba:amd64 is not selected for install + 2. bb:amd64 Depends bby + but none of the choices are installable: + [no choices]" apt install unsat --solver 3.0 -- cgit v1.2.3-70-g09d2