FYI, lvs.ml: Unbound value Guestfs.create
FYI, while "make" succeeded in this directory on Friday, I ran "make clean" today from the top, then "make" and got this: Making all in examples make[3]: Entering directory `/home/j/w/co/libguestfs/ocaml/examples' ocamlfind ocamlopt \ -warn-error A -I .. mlguestfs.cmxa lvs.ml -o lvs File "lvs.ml", line 11, characters 10-24: Error: Unbound value Guestfs.create make[3]: *** [lvs] Error 2 make[3]: Leaving directory `/home/j/w/co/libguestfs/ocaml/examples' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/j/w/co/libguestfs/ocaml' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/j/w/co/libguestfs' make: *** [all] Error 2 [Exit 2]
On Sun, Oct 04, 2009 at 11:31:57AM +0200, Jim Meyering wrote:
FYI, while "make" succeeded in this directory on Friday, I ran "make clean" today from the top, then "make" and got this:
Making all in examples make[3]: Entering directory `/home/j/w/co/libguestfs/ocaml/examples' ocamlfind ocamlopt \ -warn-error A -I .. mlguestfs.cmxa lvs.ml -o lvs File "lvs.ml", line 11, characters 10-24: Error: Unbound value Guestfs.create
You would get this error only if the file ocaml/guestfs.cmi didn't exist. Is it possible that the ocaml/examples directory is being compiled before the ocaml/ directory (ie. parallel make)? Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
Richard W.M. Jones wrote:
On Sun, Oct 04, 2009 at 11:31:57AM +0200, Jim Meyering wrote:
FYI, while "make" succeeded in this directory on Friday, I ran "make clean" today from the top, then "make" and got this:
Making all in examples make[3]: Entering directory `/home/j/w/co/libguestfs/ocaml/examples' ocamlfind ocamlopt \ -warn-error A -I .. mlguestfs.cmxa lvs.ml -o lvs File "lvs.ml", line 11, characters 10-24: Error: Unbound value Guestfs.create
You would get this error only if the file
ocaml/guestfs.cmi
didn't exist. Is it possible that the ocaml/examples directory is being compiled before the ocaml/ directory (ie. parallel make)?
Bingo. This fixes it for me:
From 842c0ea5a954250828bbe765365c7b52430d8e10 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Mon, 5 Oct 2009 12:25:15 +0200 Subject: [PATCH libguestfs] build: avoid parallel ocaml/... build failure
A parallel build could fail due to the use in ocaml/examples of ocaml/guestfs.cmi before it was built. * Makefile.am (SUBDIRS): Add both ocaml and ocaml/examples, to ensure they're built in this order, and not in parallel. * ocaml/Makefile.am (SUBDIRS): Don't define. --- Makefile.am | 2 +- ocaml/Makefile.am | 2 -- 2 files changed, 1 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index fce4af2..90c51f1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,7 @@ SUBDIRS = gnulib/lib src daemon appliance fish po examples images \ gnulib/tests capitests regressions test-tool if HAVE_OCAML -SUBDIRS += ocaml +SUBDIRS += ocaml ocaml/examples endif if HAVE_PERL SUBDIRS += perl diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index 462404c..c89296b 100644 --- a/ocaml/Makefile.am +++ b/ocaml/Makefile.am @@ -23,8 +23,6 @@ EXTRA_DIST = \ run-bindtests \ t/*.ml -SUBDIRS = examples - CLEANFILES = *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so CLEANFILES += t/*.cmi t/*.cmo t/*.cmx t/*.o t/*.a t/*.so -- 1.6.5.rc2.204.g8ea19
On Mon, Oct 05, 2009 at 12:25:46PM +0200, Jim Meyering wrote:
Bingo. This fixes it for me:
From 842c0ea5a954250828bbe765365c7b52430d8e10 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Mon, 5 Oct 2009 12:25:15 +0200 Subject: [PATCH libguestfs] build: avoid parallel ocaml/... build failure
A parallel build could fail due to the use in ocaml/examples of ocaml/guestfs.cmi before it was built. * Makefile.am (SUBDIRS): Add both ocaml and ocaml/examples, to ensure they're built in this order, and not in parallel. * ocaml/Makefile.am (SUBDIRS): Don't define.
Thanks - please push. But note that's an earlier bug with parallel builds, also in the OCaml directory: https://bugzilla.redhat.com/show_bug.cgi?id=502309 http://git.et.redhat.com/?p=libguestfs.git;a=commitdiff;h=76711b7e918f6dc504... It seems like your fix will NOT break this earlier fix. Is that right? Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 75 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
Richard W.M. Jones wrote:
On Mon, Oct 05, 2009 at 12:25:46PM +0200, Jim Meyering wrote:
Bingo. This fixes it for me:
From 842c0ea5a954250828bbe765365c7b52430d8e10 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Mon, 5 Oct 2009 12:25:15 +0200 Subject: [PATCH libguestfs] build: avoid parallel ocaml/... build failure
A parallel build could fail due to the use in ocaml/examples of ocaml/guestfs.cmi before it was built. * Makefile.am (SUBDIRS): Add both ocaml and ocaml/examples, to ensure they're built in this order, and not in parallel. * ocaml/Makefile.am (SUBDIRS): Don't define.
Thanks - please push.
Done.
But note that's an earlier bug with parallel builds, also in the OCaml directory:
https://bugzilla.redhat.com/show_bug.cgi?id=502309 http://git.et.redhat.com/?p=libguestfs.git;a=commitdiff;h=76711b7e918f6dc504...
It seems like your fix will NOT break this earlier fix. Is that right?
Yes.
Is there some rule about what can run in parallel and what can't? For instance in the toplevel Makefile.am we have: SUBDIRS = gnulib/lib src daemon appliance fish po examples images \ gnulib/tests capitests regressions test-tool If these were to run in parallel, we'd be in trouble, but I'm assuming they don't do that because we'd have seen it by now. automake.info is quiet on the issue AFAICT. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
Richard W.M. Jones wrote:
Is there some rule about what can run in parallel and what can't?
For instance in the toplevel Makefile.am we have:
SUBDIRS = gnulib/lib src daemon appliance fish po examples images \ gnulib/tests capitests regressions test-tool
Each name in $(SUBDIRS) is completed before the build in the next one starts. We've seen that targets in the current Makefile.am can be built in parallel with any of those in SUBDIRS.
If these were to run in parallel, we'd be in trouble, but I'm assuming they don't do that because we'd have seen it by now.
automake.info is quiet on the issue AFAICT.
This is a good argument for avoiding sub-makes. On my list of experiments is to convert a project with non-empty SUBDIRS to build via a single top-level make that includes pieces from sub-directories. Improved parallelism via a complete dependency tree is one advantage, since tools that don't need libraries don't have to wait for an early library-build to finish before starting.
On 05/10/09 14:14, Jim Meyering wrote:
This is a good argument for avoiding sub-makes. On my list of experiments is to convert a project with non-empty SUBDIRS to build via a single top-level make that includes pieces from sub-directories. Improved parallelism via a complete dependency tree is one advantage, since tools that don't need libraries don't have to wait for an early library-build to finish before starting.
I actually did this once for a big project with many subdirectories, using automake. I ended up with a single, top level makefile with all the properties you describe. However, the other property it had was that it was so big it took make 15 seconds to parse it. Although it slightly improved a complete rebuild, the overhead made frequent small, partial rebuilds too annoying. I junked it. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
On Mon, Oct 05, 2009 at 03:14:51PM +0200, Jim Meyering wrote:
This is a good argument for avoiding sub-makes. On my list of experiments is to convert a project with non-empty SUBDIRS to build via a single top-level make that includes pieces from sub-directories. Improved parallelism via a complete dependency tree is one advantage, since tools that don't need libraries don't have to wait for an early library-build to finish before starting.
Indeed: http://miller.emu.id.au/pmiller/books/rmch/ Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
On 05/10/09 14:35, Richard W.M. Jones wrote:
Indeed:
This is what prompted my experiment. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
participants (3)
-
Jim Meyering -
Matthew Booth -
Richard W.M. Jones