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

Dependency disapearance? #47

Closed
palainp opened this issue Mar 11, 2023 · 1 comment
Closed

Dependency disapearance? #47

palainp opened this issue Mar 11, 2023 · 1 comment

Comments

@palainp
Copy link

palainp commented Mar 11, 2023

Dear developpers, my experiences are related to mirage and opam-monorepo which use the 0install solver and for some reason it fails to find a solution for unikernels with Ocaml5.

I tried adding the following to the loglines, the idea is that Context.candidates gives a list of (version, opam packages) and the dependencies should be the same later in the filter_map in implementation (or am I wrong?) :

diff --git a/lib/model.ml b/lib/model.ml
index 8ae935f..e10f025 100644
--- a/lib/model.ml
+++ b/lib/model.ml
@@ -180,6 +180,7 @@ module Make (Context : S.CONTEXT) = struct
         |> List.filter_map (function
             | _, Error _rejection -> None
             | version, Ok opam ->
+OpamConsole.warning "implementations for %S.%S with depends %S" (OpamPackage.Name.to_string role.name) (OpamPackage.Version.to_string version) (OpamFilter.string_of_filtered_formula @@ OpamFile.OPAM.depends opam);
               let pkg = OpamPackage.create role.name version in
               (* Note: we ignore depopts here: see opam/doc/design/depopts-and-features *)
               let requires =
diff --git a/lib/switch_context.ml b/lib/switch_context.ml
index 42f39fb..073e5c0 100644
--- a/lib/switch_context.ml
+++ b/lib/switch_context.ml
@@ -48,6 +48,7 @@ let candidates t name =
           v, Error (UserConstraint (name, Some test))
         | _ ->
           let opam = load t (OpamPackage.create name v) in
+OpamConsole.warning "candidates for %S.%S with depends %S" (OpamPackage.Name.to_string name) (OpamPackage.Version.to_string v) (OpamFilter.string_of_filtered_formula @@ OpamFile.OPAM.depends opam);
           (* Note: [OpamStateTypes.available_packages] filters out unavailable packages for us. *)
           v, Ok opam
       )

This produce something strange (I already identified base-domains to be related to the mirage/opam-monorepo solution error):

...
[WARNING] candidates for "base-domains"."base" with depends "ocaml >= \"5.0\" | ocaml-variants {= \"4.14.0+domains\" | = \"4.12.0+domains+effects\" | = \"4.12.0+domains\" | = \"4.10.0+multicore\" | = \"4.10.0+multicore+no-effect-syntax\" | = \"4.06.1+multicore\"}"
[WARNING] implementations for "base-domains"."base" with depends "ocaml-variants {= \"4.14.0+domains\" | = \"4.12.0+domains+effects\" | = \"4.12.0+domains\" | = \"4.10.0+multicore\" | = \"4.10.0+multicore+no-effect-syntax\" | = \"4.06.1+multicore\"}"
...

My issue is that the ocaml >= \"5.0\" dependency disapears immediatly :(

For some other opam packages the depends are the same for both loglines as they should (to me):

[WARNING] candidates for "base-nnp"."base" with depends "base-domains | ocaml-option-nnp | ocaml-variants = \"4.06.1+no-naked-pointers+flambda\""
[WARNING] implementations for "base-nnp"."base" with depends "base-domains | ocaml-option-nnp | ocaml-variants = \"4.06.1+no-naked-pointers+flambda\""

This may be a red herring and I'm currently unsure how to step forward. Do you have any advice?

@palainp palainp changed the title Dependencie disapearance? Dependency disapearance? Mar 11, 2023
@palainp
Copy link
Author

palainp commented Mar 12, 2023

Sorry for the noise, the ocaml package in the dependencies list is removed by opam-monorepo. Everything is right here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant