From 9b8aaaa7abbf36d937dbf7160caa2d9c7c92871f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 5 Feb 2025 22:06:38 +0100 Subject: solver3: Reject reverse conflicts on install We forgot this in the previous iteration. This makes the reasoning in the test cases much nicer and apt-test's mantic-to-noble-jak.edsp now finishes rather than running into the timeout (potentially forever). --- apt-pkg/solver3.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'apt-pkg/solver3.cc') diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 2d9e92c99..8af3275eb 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -382,6 +382,15 @@ bool APT::Solver::Propagate() for (auto &clause : (*this)[var].clauses) if (not AddWork(Work{clause.get(), depth()})) return false; + for (auto rclause : (*this)[var].rclauses) + { + if (not rclause->negative || rclause->optional || rclause->reason.empty()) + continue; + if (unlikely(debug >= 3)) + std::cerr << "Propagate " << var.toString(cache) << " to NOT " << rclause->reason.toString(cache) << " for dep " << const_cast(rclause)->toString(cache) << std::endl; + if (not Enqueue(rclause->reason, false, var)) + return false; + } } else if ((*this)[var].decision == Decision::MUSTNOT) { -- cgit v1.2.3-70-g09d2