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

Allow arbitrary opam depopt disjunction represntations #11099

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 5 additions & 6 deletions src/dune_pkg/opam_solver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -551,19 +551,18 @@ let opam_file_is_compiler (opam_package : OpamFile.OPAM.t) =
;;

let resolve_depopts ~resolve depopts =
(let rec collect acc depopts =
(let rec collect depopts =
match (depopts : OpamTypes.filtered_formula) with
| Or ((Atom (_, _) as dep), depopts) -> collect (dep :: acc) depopts
| Atom (_, _) -> depopts :: acc
| Empty -> acc
| Or (lhs, rhs) -> collect lhs @ collect rhs
| Atom (_, _) -> [ depopts ]
| Empty -> []
| _ ->
(* We rely on depopts always being a list of or'ed package names. Opam
verifies this for us at parsing time. Dune projects have this
restriction for depopts and regular deps *)
Code_error.raise "invalid depopts" [ "depopts", Opam_dyn.filtered_formula depopts ]
in
collect [] depopts)
|> List.rev
collect depopts)
|> List.concat_map ~f:(fun depopt ->
match resolve depopt with
| Error _ -> []
Expand Down
Loading