ocamldep -all seems to break builds on platforms without a native compiler
Hi, I have been trying to catch up my Debian packages to the current 1.27 branch of libguestfs (and uploaded those packages to experimental), but apparently the build was broken for architectures where no native OCaml compiler is available because make wanted to build .cmx files -- see <https://buildd.debian.org/status/package.php?p=libguestfs&suite=experimental>. So far mips[1], ppc64el[2], and s390x[3] builds have failed with the same error. It looks like this commit ,---- | commit a3881445efd04d5fe6da29db8b2d62a30088b9d1 | Author: Richard W.M. Jones <rjones@redhat.com> | Date: Mon Sep 1 22:24:14 2014 +0100 | | Use ocamldep -all option. `---- caused the build to break. After reverting it, everything worked fine, at least that's what I found on ppc64el. What does this -all switch do anyhow? It certainly seems that ocamldep and/or ocamlfind documentation are lacking. Cheers, -Hilko [1] https://buildd.debian.org/status/fetch.php?pkg=libguestfs&arch=mipsel&ver=1%3A1.27.44-1&stamp=1410672683 [2] https://buildd.debian.org/status/fetch.php?pkg=libguestfs&arch=ppc64el&ver=1%3A1.27.44-1&stamp=1410649974 [3] https://buildd.debian.org/status/fetch.php?pkg=libguestfs&arch=s390x&ver=1%3A1.27.44-1&stamp=1410650468
On Sun, Sep 14, 2014 at 05:07:57PM +0200, Hilko Bengen wrote:
Hi,
I have been trying to catch up my Debian packages to the current 1.27 branch of libguestfs (and uploaded those packages to experimental), but apparently the build was broken for architectures where no native OCaml compiler is available because make wanted to build .cmx files -- see <https://buildd.debian.org/status/package.php?p=libguestfs&suite=experimental>.
So far mips[1], ppc64el[2], and s390x[3] builds have failed with the same error.
It looks like this commit
,---- | commit a3881445efd04d5fe6da29db8b2d62a30088b9d1 | Author: Richard W.M. Jones <rjones@redhat.com> | Date: Mon Sep 1 22:24:14 2014 +0100 | | Use ocamldep -all option. `----
caused the build to break. After reverting it, everything worked fine, at least that's what I found on ppc64el.
Yes, also this commit doesn't actually fix the problem. I still see occasional problems building StringMap. I have reverted this commit.
What does this -all switch do anyhow? It certainly seems that ocamldep and/or ocamlfind documentation are lacking.
Indeed, it doesn't look as if -all is properly documented anywhere. The flag -all seems to add explicit dependencies for things like *.o files. I have attached the difference between ocamldep alone and ocamldep -all in the v2v/ directory. I suspect the answer is simply to add a v2v/stringMap.mli file. Because the Makefile.am has a *.mli -> *.cmi rule, it should cause make to generate the build order correctly. In fact, that's what I'm going to do now. 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/
--- builder/Makefile.am | 2 ++ customize/Makefile.am | 2 ++ mllib/Makefile.am | 2 ++ ocaml/Makefile.am | 4 ++++ resize/Makefile.am | 2 ++ sparsify/Makefile.am | 2 ++ sysprep/Makefile.am | 2 ++ v2v/Makefile.am | 2 ++ 8 files changed, 18 insertions(+) diff --git a/builder/Makefile.am b/builder/Makefile.am index 0ca5db6..eb6295a 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -185,8 +185,10 @@ endif $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ .ml.cmo: $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ +if HAVE_OCAMLOPT .ml.cmx: $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@ +endif # Manual pages and HTML files for the website. diff --git a/customize/Makefile.am b/customize/Makefile.am index 90234a0..746375d 100644 --- a/customize/Makefile.am +++ b/customize/Makefile.am @@ -139,8 +139,10 @@ endif $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ .ml.cmo: $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ +if HAVE_OCAMLOPT .ml.cmx: $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@ +endif # automake will decide we don't need C support in this file. Really # we do, so we have to provide it ourselves. diff --git a/mllib/Makefile.am b/mllib/Makefile.am index af0fe85..210fc64 100644 --- a/mllib/Makefile.am +++ b/mllib/Makefile.am @@ -118,8 +118,10 @@ endif $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ .ml.cmo: $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ +if HAVE_OCAMLOPT .ml.cmx: $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@ +endif # This OCaml module has to be generated by make (configure will put # unexpanded prefix macro in). diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index 8b9dcfa..94f11ef 100644 --- a/ocaml/Makefile.am +++ b/ocaml/Makefile.am @@ -147,8 +147,10 @@ endif $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ +if HAVE_OCAMLOPT %.opt: %.cmx mlguestfs.cmxa $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ +endif check-valgrind: $(MAKE) VG="$(top_builddir)/run @VG@" check @@ -160,10 +162,12 @@ guestfs.cmo: guestfs.ml $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -package unix -c $< -o $@ %.cmo: %.ml mlguestfs.cma $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -package unix -c $< -o $@ +if HAVE_OCAMLOPT guestfs.cmx: guestfs.ml $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -package unix -c $< -o $@ %.cmx: %.ml mlguestfs.cmxa $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -package unix -c $< -o $@ +endif depend: .depend diff --git a/resize/Makefile.am b/resize/Makefile.am index 91abeee..d1bc46f 100644 --- a/resize/Makefile.am +++ b/resize/Makefile.am @@ -94,8 +94,10 @@ endif $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ .ml.cmo: $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ +if HAVE_OCAMLOPT .ml.cmx: $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@ +endif # automake will decide we don't need C support in this file. Really # we do, so we have to provide it ourselves. diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am index bb3bda0..fc2777d 100644 --- a/sparsify/Makefile.am +++ b/sparsify/Makefile.am @@ -95,8 +95,10 @@ virt_sparsify_LINK = \ $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ .ml.cmo: $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ +if HAVE_OCAMLOPT .ml.cmx: $(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ +endif # Manual pages and HTML files for the website. diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am index 7b88ef5..d6dae86 100644 --- a/sysprep/Makefile.am +++ b/sysprep/Makefile.am @@ -155,8 +155,10 @@ endif $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ .ml.cmo: $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ +if HAVE_OCAMLOPT .ml.cmx: $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@ +endif # automake will decide we don't need C support in this file. Really # we do, so we have to provide it ourselves. diff --git a/v2v/Makefile.am b/v2v/Makefile.am index 553b93c..03d7442 100644 --- a/v2v/Makefile.am +++ b/v2v/Makefile.am @@ -164,8 +164,10 @@ virt_v2v_LINK = \ $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ .ml.cmo: $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ +if HAVE_OCAMLOPT .ml.cmx: $(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ +endif # Data directory. -- 2.1.0
ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
participants (2)
-
Hilko Bengen -
Richard W.M. Jones