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é <berra...@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: https://libvirt.org/git/?p=libvirt-ocaml.git;a=commit;h=db1e05d99b3cb195b19d531a8832b980e155cb1f 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. Rich. -- 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 http://libguestfs.org/virt-builder.1.html