Using dune verbose for resolution

What is a practical use case for dune resolution?

I want to use it to compile a part of a project with ocaml@4.06.1 and another with ocaml@4.12.0 and use them together. An example would using the atdgen output generated by in 4.12 in a bucklescript generated frontend.

Am i way off the reservation here? Is this possible?

Thank you .

Here, “resolution” is about interpreting target names written by the user on the command line. I.e., if the user writes "dune build ", what does <foo> refers to? We have actually been thinking of simplifying this part as it is a bit complex at the moment.

Regarding what you are trying to do, you might be able to rely on Dune’s support for cross-compilation. For instance, with the following dune-workspace file:

(lang dune 2.8)
(profile (opam (switch 4.12.0))
(profile (opam (switch 4.06.0) (host 4.12.0)))

every time Dune needs to execute a local program to in the 4.06.0 build context, it will use the corresponding program built in the 4.12.0 build context. For instance, if you have the following dune file:

(rule (with-stdout-to foo (run ./gen.exe)))

Then Dune will execute _build/4.12.0/gen.exe in order to produce _build/4.06.0/foo.

@jeremiedimino thank you sir. I will try to apply your guidance.

It would be nice to have a trivial example we could point to using this method. Are you aware of one?

I’m not aware of any unfortunately

1 Like