From 935a9ab334e55a29363f45e7de6338c47337e806 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 18 Feb 2025 13:06:32 +0100 Subject: Evaluate and fall back to the 3.0 solver Always run the 3.0 solver after the internal solver. If the internal solver failed, and the 3.0 solver did not, use the 3.0 result. If 3.0 solver failed or produced a worse result than the internal solver, write an apport crash dump. We exclude situations which we now the solver can't handle, i.e. removals are forbidden and you requested removals, and stuff like that. --- doc/examples/configure-index | 1 + 1 file changed, 1 insertion(+) (limited to 'doc') diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 8476d733a..d6d76930c 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -464,6 +464,7 @@ Dir "" Boot ""; Usr ""; + Apport ""; }; // Things that effect the APT dselect method -- cgit v1.2.3-70-g09d2 From 6c112f9860c1730237029f4e23d40bf658d73704 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 9 Mar 2025 13:55:23 +0100 Subject: Print --solver 3.0 explanation if both internal and it failed This can provide useful additional context. To avoid updating the whole test suite for it, introduce a new option `quiet::NoSolver3Explanation` and set it by default. All the other tests that assert output will already have matching tests for --solver 3.0 with the correct messages asserted, it makes no sense to duplicate them. --- apt-private/private-install.cc | 3 +++ doc/examples/configure-index | 1 + test/integration/framework | 2 ++ test/integration/test-solver3-evaluation | 21 ++++++++++++++++++++- 4 files changed, 26 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index cb9f93e9e..29e23a57e 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -1024,6 +1024,9 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, std::vectorFindB("quiet::NoSolver3Explanation", false)) + _error->Error("The following information from --solver 3.0 may provide additional context:\n%s", APT::String::Join(errors, "\n").c_str()); } // If the 3.0 solver could not recover either, abort. _error->MergeWithStack(); diff --git a/doc/examples/configure-index b/doc/examples/configure-index index d6d76930c..c36f922b6 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -33,6 +33,7 @@ quiet "" { NoUpdate ""; // never update progress information - included in -q=1 NoProgress ""; // disables the 0% → 100% progress on cache generation and stuff NoStatistic ""; // no "42 kB downloaded" stats in update + NoSolver3Explanation ""; // do not print solver3 explanations when used with internal solver ReleaseInfoChange "" // don't even print the notices if the info change is allowed { Origin ""; diff --git a/test/integration/framework b/test/integration/framework index d2570b6b2..3f0290569 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -589,6 +589,8 @@ EOF echo 'DPkg::Path "";' >> aptconfig.conf echo 'Dir::Bin::ischroot "/bin/false";' >> aptconfig.conf + echo 'quiet::NoSolver3Explanation "true";' > rootdir/etc/apt/apt.conf.d/disable-solver3-context + # most tests just need one signed Release file, not both export APT_DONT_SIGN='Release.gpg' diff --git a/test/integration/test-solver3-evaluation b/test/integration/test-solver3-evaluation index d3521e9c6..af12698b5 100755 --- a/test/integration/test-solver3-evaluation +++ b/test/integration/test-solver3-evaluation @@ -16,6 +16,7 @@ insertpackage 'unstable' 'c' 'all' '3' setupaptarchive +rm rootdir/etc/apt/apt.conf.d/disable-solver3-context mkdir rootdir/var/log/apt testsuccess aptget install y x --solver internal -s -o Dir::Apport=var/crash @@ -217,4 +218,22 @@ APT-Pin: 100 APT-Candidate: yes " cat rootdir/var/log/apt/edsp.log - +testfailureequal "Reading package lists... +Building dependency tree... +Package 'c' is not installed, so not removed +Solving dependencies... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +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: + +The following packages have unmet dependencies: + a : Depends: c but it is not going to be installed +E: Unable to correct problems, you have held broken packages. +E: The following information from --solver 3.0 may provide additional context: + Unable to satisfy dependencies. Reached two conflicting decisions: + 1. a:amd64=3 is selected for install + 2. a:amd64 Depends c + but none of the choices are installable: + - c:amd64 is not selected for install" apt install -s a c- --solver internal -- cgit v1.2.3-70-g09d2