From 036aab424f917b0b8e9b878e402c05e733f312a3 Mon Sep 17 00:00:00 2001 From: konstin Date: Thu, 12 Dec 2024 13:42:19 +0100 Subject: [PATCH] Allow access to undecided packages Allow introspecting which packages are to be decided. uv currently uses this for (trace) logging in the resolver. --- src/internal/partial_solution.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/internal/partial_solution.rs b/src/internal/partial_solution.rs index 22115388..63279c1d 100644 --- a/src/internal/partial_solution.rs +++ b/src/internal/partial_solution.rs @@ -214,6 +214,13 @@ impl PartialSolution { self.next_global_index += 1; } + /// The list of package that have not been selected after the last prioritization. + /// + /// This list gets updated by [`Self::pick_highest_priority_pkg`] and cleared by backtracking. + pub fn undecided_packages(&self) -> impl Iterator, &DP::Priority)> { + self.prioritized_potential_packages.iter() + } + /// Add a derivation. pub(crate) fn add_derivation( &mut self,