fix: preserve channel priority for direct dependencies#2184
fix: preserve channel priority for direct dependencies#2184mohitdebian wants to merge 8 commits intoconda:mainfrom
Conversation
Fixes conda#1928 The repodata gateway filtered records for direct dependencies before they reached the solver. If a higher-priority channel contained the package but no version matching the spec, all records from that channel were removed. The solver then treated a lower-priority channel as the first channel containing the package. Modify accumulate_records() so that when no records match the MatchSpec, records from the channel are still included. This allows the solver to detect channel ownership and correctly enforce strict channel priority. Added regression test where: - Channel A (higher priority) contains only older versions - Channel B (lower priority) contains a newer version - Spec requires the newer version With strict channel priority the solve now correctly fails instead of selecting the lower-priority channel.
baszalmstra
left a comment
There was a problem hiding this comment.
The downside is that we match twice now. Which is just wasted performance..
|
Thanks for pointing that out. I've updated the implementation so the matching is done in a single pass while keeping the same behavior when nothing matches |
baszalmstra
left a comment
There was a problem hiding this comment.
that's not what i meant. i meant that is a waste in the solver where we run all sorts of checks on records of which we know will never match. I think a better approach would be to change the input of solvertask so we know per channel the name it contains even though it might not contain records for that name
|
thanks for the clarification i've updated the implementation so the solver now knows which package names exist per channel instead of passing non matching records |
|
This is not a good solution because it decouples the |
Fixes #1928
Problem
The repodata gateway filtered records for direct dependencies before they reached the solver. If a higher-priority channel contained the package but no version matching the spec, all records from that channel were removed. The solver then treated a lower-priority channel as the first channel containing the package.
Solution
Modify
accumulate_records()so that when no records match theMatchSpec, records from the channel are still included. This allows the solver to detect channel ownership and correctly enforce strict channel priority.Tests
Added regression test where:
With strict channel priority the solve now fails instead of selecting the lower-priority channel.