Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MirageOS - Unable to build unikernel for XEN

I've written a simple MirageOS-based Unikernel to execute a basic HTTP GET call. While it is working without any problems when I run it as a Unix binary, the moment I configure it for XEN (mirage configure --xen) and launch the make command, I get the following error:

ocamlbuild -use-ocamlfind -pkgs lwt.syntax,cohttp.lwt,cohttp.lwt-core,mirage-console.xen,mirage-http,mirage-types.lwt -tags "syntax(camlp4o),annot,bin_annot,strict_sequence,principal" -tag-line "<static*.*>: -syntax(camlp4o)" -cflag -g -lflags -g,-linkpkg,-dontlink,unix main.native.o
+ ocamlfind ocamlopt -g -linkpkg -dontlink unix -output-obj -package mirage-types.lwt -package mirage-http -package mirage-console.xen -package cohttp.lwt-core -package cohttp.lwt -package lwt.syntax -syntax camlp4o unikernel.cmx main.cmx -o main.native.o
File "_none_", line 1:
Error: No implementations provided for the following modules:
         Unix referenced from /home/mirage/.opam/system/lib/lwt/lwt-unix.cmxa(Lwt_engine),
           /home/mirage/.opam/system/lib/lwt/lwt-unix.cmxa(Lwt_unix),
           /home/mirage/.opam/system/lib/lwt/lwt-unix.cmxa(Lwt_io),
           /home/mirage/.opam/system/lib/lwt/lwt-unix.cmxa(Lwt_log),
           /home/mirage/.opam/system/lib/ipaddr/ipaddr_unix.cmxa(Ipaddr_unix),
           /home/mirage/.opam/system/lib/xenstore_transport/xenstore_transport_lwt_unix.cmxa(Xs_transport_lwt_unix_client),
           /home/mirage/.opam/system/lib/conduit/conduit-lwt-unix.cmxa(Conduit_lwt_unix),
           /home/mirage/.opam/system/lib/cohttp/cohttp_lwt_unix.cmxa(Cohttp_lwt_unix_debug),
           /home/mirage/.opam/system/lib/cohttp/cohttp_lwt_unix.cmxa(Cohttp_lwt_unix)
Command exited with code 2.
Compilation unsuccessful after building 7 targets (0 cached) in 00:00:03.
make: *** [main.native.o] Error 10

I just started working with MirageOS and OCaml so it might be a stupid question but right now I really don't know what to do.

like image 790
Vittorio Cozzolino Avatar asked Feb 10 '16 14:02

Vittorio Cozzolino


1 Answers

You should not use Cohttp_lwt_unix. As the name suggests, it runs on unix, not on xen. If you want an example of a webserver that is xen-proof, you can look at this skeleton or at the code used by mirage-seal.

like image 92
Drup Avatar answered Oct 21 '22 11:10

Drup