[PATCH ocaml 0/3] Small fixes for OCaml 4.10.

Richard W.M. Jones posted 3 patches 4 years, 3 months ago
Failed in applying to current master (apply log)
[PATCH ocaml 0/3] Small fixes for OCaml 4.10.
Posted by Richard W.M. Jones 4 years, 3 months ago
Basically OCaml 4.10 is much more strict about the difference between
string (immutable) and bytes (mutable).

Rich.


Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.
Posted by Daniel P. Berrangé 4 years, 2 months ago
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@redhat.com>

I presume this will fix the rawhide CI failure we have with ocaml
now.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.
Posted by Richard W.M. Jones 4 years, 2 months ago
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@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?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.
Posted by Daniel P. Berrangé 4 years, 2 months ago
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@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

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.
Posted by Richard W.M. Jones 4 years, 2 months ago
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@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/

Yes, that's all caused by the OCaml 4.10 update.

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

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.
Posted by Daniel P. Berrangé 4 years, 2 months ago
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@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


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.
Posted by Richard W.M. Jones 4 years, 2 months ago
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@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

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.
Posted by Daniel P. Berrangé 4 years, 2 months ago
On Sat, Jan 25, 2020 at 10:55:33AM +0000, Richard W.M. Jones wrote:
> 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@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.

Yes, that did the job for all broken platforms.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.
Posted by Richard W.M. Jones 4 years, 2 months ago
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@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

We probably need some #define Bytes_val String_val to cope
with the older versions of OCaml.  I'll have a look when I'm
back home.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.
Posted by Richard W.M. Jones 4 years, 2 months ago
Seems like the CI test is passing now.

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

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.
Posted by Richard W.M. Jones 4 years, 2 months ago
I pushed those patches, so hopefully you should see the CI
job being fixed shortly.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
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/