[libvirt] [PATCH] build: fix 'make dist' for ./configure --without-remote

Anything generated that must end up in the tarball must either have unconditional rules for generation (remote_protocol.c) or must live in libvirt.git for the case where the person running 'make dist' has disabled the configure options that control the rebuild of the generated file (remote_protocol-structs). * src/Makefile.am (remote_protocol-structs): Add a dependency and document why it must live in git. ($(srcdir)/remote/%_protocol.c, $(srcdir)/remote/%_protocol.c): Unconditionally generate. --- This should be the last piece of the puzzle for fixing an issue that I first pointed out here: https://www.redhat.com/archives/libvir-list/2011-May/msg00343.html src/Makefile.am | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 75ece49..af65158 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -206,7 +206,8 @@ r1 = (?:/\* \d+ \*/\n)? r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/ .PHONY: remote_protocol-structs -remote_protocol-structs: +if WITH_REMOTE +remote_protocol-structs: libvirt_driver_remote_la-remote_protocol.$(OBJEXT) $(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then \ pdwtags --verbose libvirt_driver_remote_la-remote_protocol.$(OBJEXT) \ | perl -0777 -n \ @@ -232,12 +233,17 @@ remote_protocol-structs: -e ' }' \ -e '}' \ > $@-t; \ - case $$? in 8) exit 0;; 0) ;; *) exit 1;; esac; \ + case $$? in 8) exit 0;; 0) ;; *) exit 1;; esac; \ diff -u $@-t $(srcdir)/$@; st=$$?; rm -f $@-t; exit $$st; \ else \ echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2; \ echo 'WARNING: install the dwarves package to get pdwtags' >&2; \ fi +else !WITH_REMOTE +# This generated file must live in git, because it cannot be re-generated +# when configured --without-remote. +remote_protocol-structs: +endif EXTRA_DIST += remote_protocol-structs check-local: remote_protocol-structs @@ -551,6 +557,8 @@ libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES) $(srcdir)/remote/remote_driver.c: $(REMOTE_DRIVER_GENERATED) +endif WITH_REMOTE + $(srcdir)/remote/%_protocol.c: $(srcdir)/remote/%_protocol.x \ $(srcdir)/remote/%_protocol.h $(srcdir)/remote/rpcgen_fix.pl $(AM_V_GEN)perl -w $(srcdir)/remote/rpcgen_fix.pl $(RPCGEN) -c \ @@ -561,8 +569,6 @@ $(srcdir)/remote/%_protocol.h: $(srcdir)/remote/%_protocol.x \ $(AM_V_GEN)perl -w $(srcdir)/remote/rpcgen_fix.pl $(RPCGEN) -h \ $< $@ -endif - if WITH_XEN if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_xen.la -- 1.7.4.4

At 05/12/2011 04:30 AM, Eric Blake Write:
Anything generated that must end up in the tarball must either have unconditional rules for generation (remote_protocol.c) or must live in libvirt.git for the case where the person running 'make dist' has disabled the configure options that control the rebuild of the generated file (remote_protocol-structs).
* src/Makefile.am (remote_protocol-structs): Add a dependency and document why it must live in git. ($(srcdir)/remote/%_protocol.c, $(srcdir)/remote/%_protocol.c): Unconditionally generate. ---
This should be the last piece of the puzzle for fixing an issue that I first pointed out here: https://www.redhat.com/archives/libvir-list/2011-May/msg00343.html
src/Makefile.am | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 75ece49..af65158 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -206,7 +206,8 @@ r1 = (?:/\* \d+ \*/\n)? r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/
.PHONY: remote_protocol-structs -remote_protocol-structs: +if WITH_REMOTE +remote_protocol-structs: libvirt_driver_remote_la-remote_protocol.$(OBJEXT)
This line will introduce another problem for ./configure --with-remote: make[1]: *** No rule to make target `libvirt_driver_remote_la-remote_protocol.o', needed by `remote_protocol-structs'. Stop. make[1]: Leaving directory `/home/wency/source/libvirt-nodaemon/src' make: *** [distdir] Error 1
$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then \ pdwtags --verbose libvirt_driver_remote_la-remote_protocol.$(OBJEXT) \ | perl -0777 -n \ @@ -232,12 +233,17 @@ remote_protocol-structs: -e ' }' \ -e '}' \ > $@-t; \ - case $$? in 8) exit 0;; 0) ;; *) exit 1;; esac; \ + case $$? in 8) exit 0;; 0) ;; *) exit 1;; esac; \ diff -u $@-t $(srcdir)/$@; st=$$?; rm -f $@-t; exit $$st; \ else \ echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2; \ echo 'WARNING: install the dwarves package to get pdwtags' >&2; \ fi +else !WITH_REMOTE +# This generated file must live in git, because it cannot be re-generated +# when configured --without-remote. +remote_protocol-structs: +endif EXTRA_DIST += remote_protocol-structs check-local: remote_protocol-structs
@@ -551,6 +557,8 @@ libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
$(srcdir)/remote/remote_driver.c: $(REMOTE_DRIVER_GENERATED)
+endif WITH_REMOTE + $(srcdir)/remote/%_protocol.c: $(srcdir)/remote/%_protocol.x \ $(srcdir)/remote/%_protocol.h $(srcdir)/remote/rpcgen_fix.pl $(AM_V_GEN)perl -w $(srcdir)/remote/rpcgen_fix.pl $(RPCGEN) -c \ @@ -561,8 +569,6 @@ $(srcdir)/remote/%_protocol.h: $(srcdir)/remote/%_protocol.x \ $(AM_V_GEN)perl -w $(srcdir)/remote/rpcgen_fix.pl $(RPCGEN) -h \ $< $@
-endif - if WITH_XEN if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_xen.la

On 05/15/2011 08:51 PM, Wen Congyang wrote:
At 05/12/2011 04:30 AM, Eric Blake Write:
Anything generated that must end up in the tarball must either have unconditional rules for generation (remote_protocol.c) or must live in libvirt.git for the case where the person running 'make dist' has disabled the configure options that control the rebuild of the generated file (remote_protocol-structs).
* src/Makefile.am (remote_protocol-structs): Add a dependency and document why it must live in git. ($(srcdir)/remote/%_protocol.c, $(srcdir)/remote/%_protocol.c): Unconditionally generate. ---
This should be the last piece of the puzzle for fixing an issue that I first pointed out here: https://www.redhat.com/archives/libvir-list/2011-May/msg00343.html
This patch still isn't in. Should it be?
.PHONY: remote_protocol-structs -remote_protocol-structs: +if WITH_REMOTE +remote_protocol-structs: libvirt_driver_remote_la-remote_protocol.$(OBJEXT)
This line will introduce another problem for ./configure --with-remote: make[1]: *** No rule to make target `libvirt_driver_remote_la-remote_protocol.o', needed by `remote_protocol-structs'. Stop. make[1]: Leaving directory `/home/wency/source/libvirt-nodaemon/src' make: *** [distdir] Error 1
I can't reproduce that failure on Fedora 14. What system were you on? Perhaps it is dependent on libtool version or automake version used to generate the Makefile? Should I isolate this change from the rest of the patch, so that 'make dist' works better from a --without-remote setup? -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 05/25/2011 04:10 PM, Eric Blake wrote:
On 05/15/2011 08:51 PM, Wen Congyang wrote:
At 05/12/2011 04:30 AM, Eric Blake Write:
Anything generated that must end up in the tarball must either have unconditional rules for generation (remote_protocol.c) or must live in libvirt.git for the case where the person running 'make dist' has disabled the configure options that control the rebuild of the generated file (remote_protocol-structs).
* src/Makefile.am (remote_protocol-structs): Add a dependency and document why it must live in git. ($(srcdir)/remote/%_protocol.c, $(srcdir)/remote/%_protocol.c): Unconditionally generate. ---
This should be the last piece of the puzzle for fixing an issue that I first pointed out here: https://www.redhat.com/archives/libvir-list/2011-May/msg00343.html
This patch still isn't in. Should it be?
Actually, I've going ahead and pushing it under the build-breaker rule (after fixing a nit below), since I was able to confirm that: mkdir build cd build ../configure --without-remote make distcheck failed without this patch, because remote_protocol.h was not in the tarball and that resulted in make trying to (re)generate the file into a read-only directory (make distcheck is time-consuming, but it's nice for proving issues like this). Furthermore, there was talk on IRC about the daily snapshots not being generated lately, precisely because they are being generated from a build configured --without-remote, so this should help snapshot builds be more useful.
.PHONY: remote_protocol-structs -remote_protocol-structs: +if WITH_REMOTE +remote_protocol-structs: libvirt_driver_remote_la-remote_protocol.$(OBJEXT)
This line will introduce another problem for ./configure --with-remote: make[1]: *** No rule to make target `libvirt_driver_remote_la-remote_protocol.o', needed by `remote_protocol-structs'. Stop. make[1]: Leaving directory `/home/wency/source/libvirt-nodaemon/src' make: *** [distdir] Error 1
I can't reproduce that failure on Fedora 14. What system were you on? Perhaps it is dependent on libtool version or automake version used to generate the Makefile? Should I isolate this change from the rest of the patch, so that 'make dist' works better from a --without-remote setup?
Oh, I think I see it now. libvirt_driver_remote_la-remote_protocol.o is a side-effect of the libtool rule for creating libvirt_driver_remote_la-remote_protocol.lo; so while the subsequent pdwtags call operates directly on the .o file, the Makefile dependency has to be on the witness .lo file that signifies whether the build has been done. I squashed this in: diff --git i/src/Makefile.am w/src/Makefile.am index 82cf6c4..c3d3102 100644 --- i/src/Makefile.am +++ w/src/Makefile.am @@ -207,7 +207,9 @@ r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/ .PHONY: remote_protocol-structs if WITH_REMOTE -remote_protocol-structs: libvirt_driver_remote_la-remote_protocol.$(OBJEXT) +# The .o file that pdwtags parses is created as a side effect of running +# libtool; but from make's perspective we depend on the .lo file. +remote_protocol-structs: libvirt_driver_remote_la-remote_protocol.lo $(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then \ pdwtags --verbose libvirt_driver_remote_la-remote_protocol.$(OBJEXT) \ | perl -0777 -n \ -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Wen Congyang