[Libguestfs] enable build for ocaml bytecode

Richard W.M. Jones rjones at redhat.com
Wed Feb 26 18:37:25 UTC 2014


On Wed, Feb 26, 2014 at 07:03:44PM +0100, Olaf Hering wrote:
> On Thu, Jan 17, Richard W.M. Jones wrote:
> 
> > On Wed, Jan 16, 2013 at 05:51:53PM +0100, Olaf Hering wrote:
> > > On Mon, Jan 14, Olaf Hering wrote:
> > > > This is a first attempt to build libguestfs with just a ocaml bytecode
> > > > compiler. The three tools written in ocaml will be build only when an
> > > > ocamlopt compiler is available.
> > > Here is a more complete change which covers also resize, sysprep and
> > > sparsify. ocaml/examples are still disabled.
> > Generally looks good.  Did you want to submit this second version or
> > should we wait for more?
> 
> So here is a 1.24.X version which appears to work, at least for the
> bytecode case.

OK, I'll need to rebase this because the upstream code has changed a bit.

Two random thoughts:

(1) This morning I discovered it's possible to make automake compile
OCaml programs, provided they contain at least one C object (which all
of ours do):

  https://github.com/libguestfs/supermin/blob/master/src/Makefile.am#L94

It needs a relatively small hack to add -l options in the right place:

  https://github.com/libguestfs/supermin/blob/master/src/supermin-link.sh.in

(2) Related to the above, I rewrote supermin.  This entailed dropping
the zypper/SUSE support *temporarily*.  I intend to add it back.  It
should in fact be simpler, as the Fedora support just uses 'rpm':

  https://github.com/libguestfs/supermin/blob/master/src/rpm.ml

and it seems likely that any RPM based distro could use the same code
(ie. SUSE support won't need to depend on zypper at all).

Except for one small point: we need a tool to download RPMs from the
repository, for which I'm using yumdownloader in that file.  So that
will need fixing for SUSE.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list