Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/conflict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,16 @@ impl<S: SolverId> ConflictGraph<S> {
| ConflictNode::Excluded(_) => continue,
};

// Candidates that require different version sets stay separate so each
// distinct requirement is reported to the user (conda/rattler#2476).
let predecessors: Vec<_> = graph
.edges_directed(node_id, Direction::Incoming)
.map(|e| e.source())
.map(|e| (e.weight().try_requires(), e.source()))
.sorted_unstable()
.collect();
let successors: Vec<_> = graph
.edges(node_id)
.map(|e| e.target())
.map(|e| (e.weight().try_requires(), e.target()))
.sorted_unstable()
.collect();

Expand Down
14 changes: 14 additions & 0 deletions tests/solver/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,20 @@ fn test_unsat_no_candidates_for_child_2() {
insta::assert_snapshot!(error);
}

// Versions requiring different versions of a missing dependency are each
// reported (conda/rattler#2476).
#[test]
fn test_unsat_no_candidates_distinct_requirements() {
let provider = BundleBoxProvider::from_packages(&[
("a", 1, vec!["b 41..42"]),
("a", 2, vec!["b 41..42"]),
("a", 3, vec!["b 42..43"]),
("a", 4, vec!["b 43..44"]),
]);
let error = solve_unsat(provider, &["a"]);
insta::assert_snapshot!(error);
}

#[test]
fn test_unsat_missing_top_level_dep_1() {
let provider = BundleBoxProvider::from_packages(&[("asdf", 1, vec![])]);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: tests/solver/main.rs
expression: error
---
a * cannot be installed because there are no viable options:
├─ a 4 would require
│ └─ b >=43, <44, for which no candidates were found.
├─ a 3 would require
│ └─ b >=42, <43, for which no candidates were found.
└─ a 1 | 2 would require
└─ b >=41, <42, for which no candidates were found.
Loading