[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] build: fix 'make distcheck' issues



We have a distributed file depending on a generated file, which is
a no-no for a VPATH build from a read-only source tree (no wonder
'make distcheck' gives us precisely that situation):

     File `libvirt_driver_remote.la' does not exist.
       File `libvirt_driver_remote_la-remote_driver.lo' does not exist.
             Prerequisite `libvirt_probes.h' is newer than target `../../src/remote/remote_protocol.h'.
            Must remake target `../../src/remote/remote_protocol.h'.
Invoking recipe from Makefile:7464 to update target `../../src/remote/remote_protocol.h'.
make[3]: Entering directory `/home/remote/eblake/libvirt-tmp2/build/libvirt-0.9.12/_build/src'
  GEN    ../../src/remote/remote_protocol.h
cannot create ../../src/remote/remote_protocol.h: Permission denied at ../../src/rpc/genprotocol.pl line 31.
make[3]: *** [../../src/remote/remote_protocol.h] Error 13

Rather than making distributed .c files depend on generated files, we
really want to ensure that compilation into .lo files is not attempted
until the generated files are present, done by this patch.  After that
fix, the next issue was that make treats './foo' and 'foo' differently
in determining whether an implicit %foo rule is applicable.  Also, the
output for using the .aug test files was a bit verbose.

After fixing that, the next error is related to the docs directory, where
the tarball is missing a stamp file and thus tries to regenerate files that
are already present:

  GEN    ../../docs/apibuild.py.stamp
Traceback (most recent call last):
  File "../../docs/apibuild.py", line 2511, in <module>
    rebuild("libvirt")
  File "../../docs/apibuild.py", line 2495, in rebuild
    builder.serialize()
  File "../../docs/apibuild.py", line 2424, in serialize
    output = open(filename, "w")
IOError: [Errno 13] Permission denied: '../../docs/libvirt-api.xml'
make[5]: *** [../../docs/apibuild.py.stamp] Error 1

and fixing that exposed another case of a distributed file (generated
html) depending on a built file (libvirt.h).

* src/Makefile.am ($(srcdir)/remote/remote_driver.c): Change...
(libvirt_driver_remote_la-remote_driver.lo): ...to the real
dependency.
($(builddir)/locking/%-sanlock.conf): Drop $(builddir), so that
rule gets run in time for test_libvirt_sanlock.aug.
(test_libvir*.aug): Cater to silent build.
(conf_DATA): Don't ship qemu-sanlock.conf in the tarball, since it
is trivial to regenerate.
* docs/Makefile.am (EXTRA_DIST): Ship our stamp file.
($(APIBUILD_STAMP)): Don't depend on generated file.
---

Painfully tested by running 'make distcheck' for each tweak until I
got it to pass.  However, I'd like a review before pushing.

 docs/Makefile.am |    5 ++++-
 src/Makefile.am  |   15 ++++++++-------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/docs/Makefile.am b/docs/Makefile.am
index a03ca3e..88407b1 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -202,11 +202,14 @@ python_generated_files = \

 APIBUILD=$(srcdir)/apibuild.py
 APIBUILD_STAMP=$(APIBUILD).stamp
+EXTRA_DIST += $(APIBUILD_STAMP)

 $(python_generated_files): $(APIBUILD_STAMP)

 $(APIBUILD_STAMP): $(srcdir)/apibuild.py \
-		$(srcdir)/../include/libvirt/*.h \
+		$(srcdir)/../include/libvirt/libvirt.h.in \
+		$(srcdir)/../include/libvirt/libvirt-qemu.h \
+		$(srcdir)/../include/libvirt/virterror.h \
 		$(srcdir)/../src/libvirt.c \
 		$(srcdir)/../src/libvirt-qemu.c \
 		$(srcdir)/../src/util/virterror.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 781c547..7b21317 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -649,7 +649,8 @@ libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                 libvirt-net-rpc.la
 libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)

-$(srcdir)/remote/remote_driver.c: $(REMOTE_DRIVER_GENERATED)
+REMOTE_DRIVER_PREREQS = $(REMOTE_DRIVER_GENERATED)
+%remote_driver.lo: $(REMOTE_DRIVER_PREREQS)

 endif WITH_REMOTE

@@ -1125,7 +1126,7 @@ EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
 if WITH_QEMU
 test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
 		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
-	$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
+	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@

 check-augeas-qemu: test_libvirtd_qemu.aug
 	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
@@ -1138,7 +1139,7 @@ endif
 if WITH_LXC
 test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
 		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
-	$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
+	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@

 check-augeas-lxc: test_libvirtd_lxc.aug
 	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
@@ -1150,7 +1151,7 @@ endif

 test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
 		locking/qemu-sanlock.conf $(AUG_GENTEST)
-	$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
+	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@

 check-augeas-sanlock: test_libvirt_sanlock.aug
 	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
@@ -1287,7 +1288,7 @@ libvirt_la_BUILT_LIBADD += libvirt_probes.lo
 libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
 nodist_libvirt_la_SOURCES = libvirt_probes.h
 if WITH_REMOTE
-$(REMOTE_DRIVER_GENERATED): libvirt_probes.h
+REMOTE_DRIVER_PREREQS += libvirt_probes.h
 endif WITH_REMOTE

 BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp
@@ -1361,12 +1362,12 @@ augeas_DATA += locking/libvirt_sanlock.aug
 augeastest_DATA += test_libvirt_sanlock.aug
 CLEANFILES += test_libvirt_sanlock.aug

-$(builddir)/locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
+locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
 	$(AM_V_GEN)$(MKDIR_P) locking ; \
 	cp $< $@

 if WITH_QEMU
-conf_DATA += locking/qemu-sanlock.conf
+nodist_conf_DATA = locking/qemu-sanlock.conf
 BUILT_SOURCES += locking/qemu-sanlock.conf
 DISTCLEANFILES += locking/qemu-sanlock.conf
 endif
-- 
1.7.7.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]