Skip to content

Commit 078b1f0

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 db821a4 commit 078b1f0

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
@@ -2876,13 +2876,14 @@ impl Forks {
28762876
// For example, if we have conflicting groups {x1, x2} and {x3,
28772877
// x4}, we need to make sure the forks generated from one set
28782878
// also account for the other set.
2879-
for groups in conflicts.iter() {
2879+
for set in conflicts.iter() {
28802880
let mut new = vec![];
28812881
for fork in std::mem::take(&mut forks) {
28822882
let mut has_conflicting_dependency = false;
2883-
for group in groups.iter() {
2884-
if fork.contains_conflicting_item(group.as_ref()) {
2883+
for item in set.iter() {
2884+
if fork.contains_conflicting_item(item.as_ref()) {
28852885
has_conflicting_dependency = true;
2886+
diverging_packages.insert(item.package().clone());
28862887
break;
28872888
}
28882889
}
@@ -2893,7 +2894,7 @@ impl Forks {
28932894

28942895
// Create a fork that excludes ALL extras.
28952896
let mut fork_none = fork.clone();
2896-
for group in groups.iter() {
2897+
for group in set.iter() {
28972898
fork_none = fork_none.exclude([group.clone()]);
28982899
}
28992900
new.push(fork_none);
@@ -2905,10 +2906,9 @@ impl Forks {
29052906
// then this creates three forks: one that excludes
29062907
// {foo, bar}, one that excludes {foo, baz} and one
29072908
// that excludes {bar, baz}.
2908-
for (i, _) in groups.iter().enumerate() {
2909+
for (i, _) in set.iter().enumerate() {
29092910
let fork_allows_group = fork.clone().exclude(
2910-
groups
2911-
.iter()
2911+
set.iter()
29122912
.enumerate()
29132913
.filter(|&(j, _)| i != j)
29142914
.map(|(_, group)| group.clone()),

0 commit comments

Comments
 (0)