[Libguestfs] FYI, lvs.ml: Unbound value Guestfs.create

Jim Meyering jim at meyering.net
Mon Oct 5 10:25:46 UTC 2009


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 at 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




More information about the Libguestfs mailing list