-
Notifications
You must be signed in to change notification settings - Fork 21
Conversation
To build config.cmxs functoria copies `config.ml` in the `_build` directory, then it generates a `dune` configuration file to be able to build `_build/_build/default/config.cmxs`. It can also grab a `dune.inc` file in order to add options to the configuration build (necessary for tests). Tests have been updated to support the modification.
By the way this enables the possibility for |
Also renamed dune.inc -> config.dune
I'll take a look at this when I have time. From a quick look, there are various hacks which I'm not fond of, I wouldn't mind input from the usual dune experts, @rgrinberg and @diml. |
Just a few comments after having a quick look at the diff:
In general, if you are trying to do something that can't be done easily with the current feature set of dune, the best is to open a ticket on github.com/dune describing what you are trying to do so that we can discuss and see what can be done. |
I agree with you on this. I translated to dune what was previously done with ocamlbuild to dune so these hacks are not of my creation. The goal is to build from a
The problem is that during tests, functoria has to launch dune inside a build context, as How could we reduce the complexity in that ? |
The above sounds like a cross compilation problem to me. You want to generate the config.cmxs in the host context, and then use it to build something in the target context. |
Would it be easier to define the tests if we consider that functoria has been previously installed? If yes, then the |
Thank you for your answers. I've been able to get rid of most hacks using the
I'll push the update soon. EDIT: Tests seems to pass but it induced another bug in Mirage unikernels, I'm working on it. |
Now `config.ml` and `dune.inc` are copied in their own `build-config` directory, where `dune` is also generated. Tests don't rely anymore on "include hacks".
"myocamlbuild.ml" (* FIXME: add a .mirage-ignore file to avoid this *) ] | ||
["main.ml"; "app.ml"; "config.dune"; ".mirage.config"; "dune"; "key_gen.ml"; | ||
"build-config"; "dune-project"; "_build" | ||
(* FIXME: add a .mirage-ignore file to avoid this *) ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a reminder, don't forget this :)
- use dune lang 1.0 instead of 1.7 when building config.ml - reuse the build-config location variable
Hmm, is using symlinks a potential issue for portability ? |
@Drup On Windows |
This looks good enough to merge and work on in |
Just a few remarks:
Once this is cleared out, I think we should merge this PR to unlock the dune+mirage port. |
Let me just note that using the |
I encounter some problems with that because
Let's use
|
Looks good, thanks! |
CHANGES: * use `dune` to build `config.ml` (@TheLortex, mirage/functoria#167) * add the ability to use external libraries un `config.ml` via an optional `dune.config` file (@TheLortex, mirage/functoria#167) * Replace dynlink method by a 2-stage build (@TheLortex, mirage/functoria#167)
The change is the following: to build
config.cmxs
functoria now symlinksconfig.ml
in the_build
directory, then it generates adune
configuration file to be able to build_build/_build/default/config.cmxs
. It can also grab adune.inc
file in order to add options to the configuration build (necessary for tests).Tests have been updated to support the modification. They all pass, and I also tested with some Mirage samples. It might be useful to test it on other setups to be sure it doesn't break anything !
(in the mirage/mirage#969 context)