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

Re: [PATCH 2/2] tools/ocaml: Default to useful build output



On Mon, 2020-07-20 at 10:38 +0200, Christian Lindig wrote:
> > Time for a bit of controversy.
> 
> OCaml outside Xen has moved to a different model of building based on
> dune which is fast, declarative and reliable. The OCaml xenstore is
> stagnating because nobody with OCaml experience wants to touch it
> anymore. It would be beneficial for the health of the OCaml xenstore
> to split it out such that it could be worked on independently.

AFAIK there are 2 unstable interfaces used by oxenstored, decoupling it
would make the version of oxenstored more independent from the version
of hypervisor: 
https://andrewcoop-xen.readthedocs.io/en/docs-devel/misc/tech-debt.html#remove-xenstored-s-dependencies-on-unstable-interfaces
IIUC this would also allow some code to be droped from the hypervisor
where oxenstored is the last user of the unstable interface.

>  You might argue that Make is still appropriate for building OCaml
> projects but the OCaml community has moved through several build
> systems, starting from Make, and learned the hard way that this is
> not an easy problem. After years of more-or-less successful build
> system the consensus is that dune is right one and it has resulted in
> combination with the Opam package manager the ecosystem to flourish.
> Alternatively, it would be possible to move OCaml xenstore to dune
> within the Xen tree but it would create a dependency on it.

I'd welcome a Dune based build-system.

The current Makefile based build-system doesn't handle dependencies
correctly for incremental development: I often have to run 'make clean'
in order to successfully build xenstored after changing an .ml file,
otherwise the linker fails with 'inconsistent assumptions over
interface', indicating that Make hasn't rebuilt something that it
should have. (For those unfamiliar with this issue, see the
'Motivation' section in 
https://nicolaspouillard.fr/ocamlbuild/ocamlbuild-user-guide.html)
It also lacks generation of .merlin files (for editor integration, e.g.
Vim or Emacs), which you get for free with Dune.

We could still retain a Makefile as an entrypoint that launches Dune
with appropriate flags, which aside from adding a build requirement on
Dune wouldn't require changes to package building.

I think a nice way forward here would be to try to write a minimal
binding to gnttab to replicate 
https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=38eeb3864d in
OCaml, this would both demonstrate the benefits of Dune (making
contribution easier), and reduce technical debt within Xen.

Best regards,
--Edwin


 


Rackspace

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