Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(pkg): remove [Requirements] #11337

Merged
merged 1 commit into from
Jan 18, 2025
Merged
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
16 changes: 4 additions & 12 deletions src/dune_pkg/opam_solver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ module Solver = struct

include T

let equal x y = Ordering.is_eq (compare x y)
let hash = Poly.hash

let user_restrictions = function
| Virtual _ -> None
| Real role ->
Expand Down Expand Up @@ -789,7 +792,6 @@ module Solver = struct
module Input = Model
module Role = Input.Role

type requirements = Role.t
type t = { selections : selection Role.Map.t }

let to_map t = t.selections
Expand Down Expand Up @@ -831,17 +833,7 @@ module Solver = struct
let decider () =
(* Walk the current solution, depth-first, looking for the first undecided interface.
Then try the most preferred implementation of it that hasn't been ruled out. *)
let seen =
let module Requirements = struct
type t = Output.requirements

let equal x y = Ordering.is_eq (Output.Role.compare x y)
let hash = Poly.hash
let to_dyn = Dyn.opaque
end
in
Table.create (module Requirements) 100
in
let seen = Table.create (module Model.Role) 100 in
let rec find_undecided req =
if Table.mem seen req
then None (* Break cycles *)
Expand Down
Loading