[PATCH ocaml 0/3] Small fixes for OCaml 4.10.
Richard W.M. Jones
rjones at redhat.com
Sat Jan 25 10:55:33 UTC 2020
On Fri, Jan 24, 2020 at 04:13:14PM +0000, Daniel P. Berrangé wrote:
> On Fri, Jan 24, 2020 at 03:01:51PM +0000, Daniel P. Berrangé wrote:
> > On Fri, Jan 24, 2020 at 02:51:39PM +0000, Richard W.M. Jones wrote:
> > > On Fri, Jan 24, 2020 at 02:35:01PM +0000, Daniel P. Berrangé wrote:
> > > > On Sun, Jan 19, 2020 at 01:04:07PM +0000, Richard W.M. Jones wrote:
> > > > > Basically OCaml 4.10 is much more strict about the difference between
> > > > > string (immutable) and bytes (mutable).
> > > >
> > > > For all patches
> > > >
> > > > Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>
> > > >
> > > > I presume this will fix the rawhide CI failure we have with ocaml
> > > > now.
> > >
> > > Well the previous code didn't compile with OCaml 4.10 at all, so I
> > > guess so. However I wasn't previously aware we even had CI for this.
> > > Do you have a link?
> > Rawhide was succeeding until most recent build:
> > https://ci.centos.org/view/libvirt/job/libvirt-ocaml-build/
> > which I presume matches when the VM got updated to ocaml 4.10
> While it passes 4.10 and Fedora 30/31 with ocaml 4.9, it fails
> on CentOS 7 with 4.05 and Debian with 4.02
OCaml < 4.06 didn't have the C macro Bytes_val, but we can use
String_val instead with a bit of casting. (The reason we can't just
use String_val in the code is because in OCaml >= 4.10 that macro was
changed to return a const as strings are now forced to be immutable).
I pushed the obvious patch:
That should fix CentOS 7 (I tested RHEL 7).
I'm fairly sure it will also fix Debian 9 (OCaml 4.02), but I don't
have that convenient at the moment.
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
More information about the libvir-list