[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OS.*

On Fri, Aug 16, 2013 at 12:30 PM, Vincent Bernardoff <vb@xxxxxxxxxxxxxx> wrote:

Just a little opinion poll who really likes having mirage-platform modules packed under OS.* ? Personally it makes the packaging of my library more complicated (because for example, xenctrl have a Eventchn module, whereas in Mirage it is OS.Eventchn, so I can't just use Eventchn in my library and be able to recompile between backends without code changes) and I don't like very much the packing feature overall.

If pack is going to be used for Mirage, do anybody see a not too annoying or ugly solution to my problem ?

A solution could be to functorize my library over all Xen-things that it uses. But it would imply that we write the signature of all Xen related packages explicitely (module type S = sig end). That would certainly work.

The drawback of this approach is that it makes my library a functor, which needs to be instanciated, and so on.

Removing the OS.* thing would make it work out of the box.

Dave pointed out that the mirage-unix package exports a OS.* namespace as well. But certainly, the UNIX version of Xen libs would not exist behind OS would they ?

The hack I was thinking of was:

In your library write

  open OS
  open Eventchn

and then link the unix version against "mirage(-unix), xenctrl" and the xen version against "mirage(-xen)". Under Unix the "open OS" is a no-op and it will get Eventchn from xenctrl while and under xen the "open OS" has the side-effect of unpacking the Eventchn from the OS module.

Does that work & make sense?


  • Follow-Ups:
  • References:
    • OS.*
      • From: Vincent Bernardoff



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.