Skip to content

Commit

Permalink
refactor: leave CR (#11448)
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>
  • Loading branch information
rgrinberg authored Feb 6, 2025
1 parent d50209c commit 271de14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dune_pkg/opam_solver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,9 @@ module Solver = struct

let compare_version a b =
match a, b with
| RealImpl a, RealImpl b -> Ordering.of_int (OpamPackage.compare a.pkg b.pkg)
| RealImpl a, RealImpl b ->
(* CR rgrinberg: shouldn't we take our version preference into account here? *)
Ordering.of_int (OpamPackage.compare a.pkg b.pkg)
| RealImpl _, _ -> Gt
| _, RealImpl _ -> Lt
| VirtualImpl (ia, _), VirtualImpl (ib, _) -> Rank.compare ia ib
Expand Down Expand Up @@ -941,6 +943,7 @@ module Solver = struct
If [t] selected a better version anyway then we don't need to report this rejection. *)
let affected_selection t impl =
match t.selected_impl with
(* CR rgrinberg: take account version preference here? *)
| Some selected when Input.Impl.compare_version selected impl = Gt -> false
| _ -> true
;;
Expand Down

0 comments on commit 271de14

Please sign in to comment.