Skip to content

Commit 3265ff5

Browse files
committed
uv-resolver: add to diverging_packages when forking based on conflicts
This addresses Konsti's comment about it being empty: #8976 (comment)
1 parent 7aed835 commit 3265ff5

File tree

1 file changed

+7
-7
lines changed
  • crates/uv-resolver/src/resolver

1 file changed

+7
-7
lines changed

crates/uv-resolver/src/resolver/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2866,13 +2866,14 @@ impl Forks {
28662866
// For example, if we have conflicting groups {x1, x2} and {x3,
28672867
// x4}, we need to make sure the forks generated from one set
28682868
// also account for the other set.
2869-
for groups in conflicts.iter() {
2869+
for set in conflicts.iter() {
28702870
let mut new = vec![];
28712871
for fork in std::mem::take(&mut forks) {
28722872
let mut has_conflicting_dependency = false;
2873-
for group in groups.iter() {
2874-
if fork.contains_conflicting_item(group.as_ref()) {
2873+
for item in set.iter() {
2874+
if fork.contains_conflicting_item(item.as_ref()) {
28752875
has_conflicting_dependency = true;
2876+
diverging_packages.insert(item.package().clone());
28762877
break;
28772878
}
28782879
}
@@ -2883,7 +2884,7 @@ impl Forks {
28832884

28842885
// Create a fork that excludes ALL extras.
28852886
let mut fork_none = fork.clone();
2886-
for group in groups.iter() {
2887+
for group in set.iter() {
28872888
fork_none = fork_none.exclude([group.clone()]);
28882889
}
28892890
new.push(fork_none);
@@ -2895,10 +2896,9 @@ impl Forks {
28952896
// then this creates three forks: one that excludes
28962897
// {foo, bar}, one that excludes {foo, baz} and one
28972898
// that excludes {bar, baz}.
2898-
for (i, _) in groups.iter().enumerate() {
2899+
for (i, _) in set.iter().enumerate() {
28992900
let fork_allows_group = fork.clone().exclude(
2900-
groups
2901-
.iter()
2901+
set.iter()
29022902
.enumerate()
29032903
.filter(|&(j, _)| i != j)
29042904
.map(|(_, group)| group.clone()),

0 commit comments

Comments
 (0)