Skip to content
Merged
Changes from 1 commit
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
8 changes: 5 additions & 3 deletions src/backend/conda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,16 @@ impl CondaBackend {
}

/// Flatten gateway RepoData into owned records for the solver, deduplicating
/// by URL to avoid DuplicateRecords errors when the same package appears in
/// multiple subdir queries (e.g. platform + noarch).
/// records that share the same archive identifier (name-version-build plus
/// archive type) — this is the same key rattler-solve uses to detect
/// duplicates, so URL-only dedup isn't sufficient when conda-forge serves
/// the same archive under multiple URLs (e.g. distinct CDN paths).
fn flatten_repodata(repodata: &[RepoData]) -> Vec<RepoDataRecord> {
let mut seen = HashSet::new();
repodata
.iter()
.flat_map(|rd| rd.iter().cloned())
.filter(|r| seen.insert(r.url.clone()))
.filter(|r| seen.insert(r.identifier.clone()))
Comment thread
jdx marked this conversation as resolved.
Outdated
.collect()
}

Expand Down
Loading