This class can be inherited to define a configurable
with an API similar to foreign
.
In particular, it allows dynamic libraries and packages. Here is an example:
let main = impl @@ object
inherit [_] foreign
~packages:["vchan"]
"Unikernel.Main" (console @-> job)
method libraries = Key.(if_ is_xen) ["vchan.xen"] ["vchan.lwt"]
end
ty
is the module type of the configurable.
name
is the unique variable name holding the runtime state of the configurable.
method module_name : string
module_name
is the name of the module implementing the configurable.
method packages : string list value
packages
is the list of OPAM packages which needs to be installed before compiling the configurable.
method libraries : string list value
libraries
is the list of OCamlfind libraries to include and link with the configurable.
method connect : Info.t -> string -> string list -> string
connect info mod args
is the code to execute in order to initialize the state associated with the module mod
(usually calling mod.connect
) with the arguments args
, in the context of the project information info
.
configure info
is the code to execute in order to configure the device. This might involve generating more OCaml code, running bash scripts, etc.
clean info
is the code to clean-up what has been generated by configure
.
keys
is the list of command-line keys to set-up the configurable.
deps
is the list of abstract implementations that must be initialized before calling connect
.