libguestfs / virt-v2v

Virt-v2v converts guests from foreign hypervisors to run on KVM
GNU General Public License v2.0
94 stars 38 forks source link

does not build with ocaml 5.0 #27

Open solsticedhiver opened 1 year ago

solsticedhiver commented 1 year ago

from what I understand the build fails because of ocaml 5.0. using ocaml-libvirt-git, the build (either 2.2.0 or 2.3.4 or git) fails with:

make[2] : on entre dans le répertoire « /home/solstice/asp/AUR/virt-v2v/src/virt-v2v-2.3.4/common/mlstdutils »
  CC       libmlstdutils_a-dummy.o
  OCAMLCMI guestfs_config.cmi
  OCAMLCMI stringMap.cmi
  OCAMLCMI stringSet.cmi
  OCAMLCMI std_utils.cmi
  OCAMLOPT guestfs_config.cmx
  OCAMLC   guestfs_config.cmo
  OCAMLC   stringSet.cmo
  OCAMLOPT stringMap.cmx
  OCAMLOPT stringSet.cmx
  OCAMLC   stringMap.cmo
  OCAMLC   std_utils.cmo
  OCAMLOPT std_utils.cmx
File "std_utils.ml", line 344, characters 30-48:
344 |     let rec assoc_lbl ?(cmp = Pervasives.compare) ~default x = function
                                    ^^^^^^^^^^^^^^^^^^
Error: Unbound module Pervasives
make[2]: *** [Makefile:1347: std_utils.cmo] Error 2
rwmjones commented 1 year ago

We've not built virt-v2v on OCaml 5 yet, but the above error should be easy to fix, simply replace every instance of Pervasives. with Stdlib. in the source code.

solsticedhiver commented 1 year ago

This seems to do it, but I bumped into another archlinux issue about


Error: /usr/lib/ocaml/guestfs/guestfs.cmi
       is not a compiled interface for this version of OCaml.```
rwmjones commented 1 year ago

That'll be because the libguestfs package was built with OCaml != 5.

juergenhoetzel commented 1 year ago

That'll be because the libguestfs package was built with OCaml != 5.

This was indeed not a upstream issue. Fixed in Arch Linux [extra] repo:

https://gitlab.archlinux.org/archlinux/packaging/packages/libguestfs/-/commit/4780699838e5fad70eb8e031438392dced998868

solsticedhiver commented 1 year ago

I don't understand why you are saying that. Because your fix includes a patch called ocaml5.patch to help build against ocaml 5.....

juergenhoetzel commented 1 year ago

I don't understand why you are saying that. Because your fix includes a patch called ocaml5.patch to help build against ocaml 5..

I see:

Error: /usr/lib/ocaml/guestfs/guestfs.cmi is not a compiled interface for this version of OCaml.```

Sorry, I was only referring to this ^^^ issue: