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
Be able to append a new dependency module on our final target #1326
Comments
I am not sure to understand what you mean:
means that |
Currently, if a module is produced by a script like:
And if you want to use this module into your unikernel, you must add it into the |
But it should already added to the Does it fail to be added only for generated files? |
It's unfortunately not the case, I can find a minimal example where such design does not work.
As far as I can say, yes, only generated files are missed by |
This is a minimal example: open Mirage
let my_module =
let dune _info =
[ Dune.stanzaf {dune|(rule
(enabled_if (= %%{context_name} "default"))
(target my_module.ml)
(action (with-stdout-to %%{target} (bash "echo \"let str = \\\"Hello\"\\\""))))|dune} ] in
impl ~dune "My_module" job
let unikernel =
foreign "Unikernel.Make"
~deps:[ dep my_module ]
(console @-> job)
let () =
register "unikernel"
[ unikernel $ default_console ] module Make (Console : Mirage_console.S) = struct
let log console fmt = Fmt.kstr (fun str -> Console.log console str) fmt
let start console _my_module =
log console "My_module.str: %S" My_module.str
end Note that without the File "unikernel.ml", line 5, characters 36-49:
5 | log console "My_module.str: %S" My_module.str
^^^^^^^^^^^^^
Error: Unbound module My_module EDIT: and if I add |
So that seems to be a bug with the interaction between |
I'm not sure, I already share by thought and be able to share between different contexts some files such as some compiled via the default context but needed to build our unikernel into our cross-compiler context. Should we make an issue on |
Yes, please! That definitely looks like a bug in |
NOTE: With the help of @TheLortex, it seems that we can transfer an artifact from the default context to our cross-compiler context via |
The workflow is simple: Be able to produce a
*.ml
file and adds it as a dependency required to produce our unikernel. Currently, the generateddune
file produce (for Solo5):It will be nice to append
my_module.ml
into themodules
field and letdune
to infer how to produce it viadeps
arguments available fromforeign
. Currently, I will try to lookup into~files
argument and see if we can introspect it and put them into themodules
field.The text was updated successfully, but these errors were encountered: