diff --git a/src/dune_pkg/opam_solver.ml b/src/dune_pkg/opam_solver.ml index be9eadf5b28..085c561b1ed 100644 --- a/src/dune_pkg/opam_solver.ml +++ b/src/dune_pkg/opam_solver.ml @@ -374,6 +374,12 @@ module Solver = struct | VirtualImpl (_, deps) -> deps | RealImpl impl -> impl.requires ;; + + let conflict_class = function + | RealImpl impl -> OpamFile.OPAM.conflict_class impl.opam + | VirtualImpl _ -> [] + | Dummy | Reject _ -> [] + ;; end let role context name = Real { context; name } @@ -446,12 +452,6 @@ module Solver = struct end) end - let conflict_class = function - | RealImpl impl -> OpamFile.OPAM.conflict_class impl.opam - | VirtualImpl _ -> [] - | Dummy | Reject _ -> [] - ;; - (* Opam uses conflicts, e.g. conflicts if X {> 1} OR Y {< 1 OR > 2} whereas 0install uses restricts, e.g. @@ -661,7 +661,7 @@ module Solver = struct (* Add [impl] to its conflict groups, if any. *) let process t impl_var impl = - Input.conflict_class impl + Input.Impl.conflict_class impl |> List.iter ~f:(fun name -> let impls = var t name in impls := impl_var :: !impls) @@ -1198,7 +1198,7 @@ module Solver = struct match Component.selected_impl component with | None -> acc | Some impl -> - Input.conflict_class impl + Input.Impl.conflict_class impl |> List.fold_left ~init:acc ~f:(fun acc x -> Input.Conflict_class.Map.set acc x role)) in @@ -1213,7 +1213,7 @@ module Solver = struct Some (`ClassConflict (other_role, cl)) | _ -> aux cls) in - aux (Input.conflict_class impl))) + aux (Input.Impl.conflict_class impl))) ;; let of_result impls =