[libvirt] [PATCH] docs: Serialize running apibuild.py

Use a witness file approach like we do for python/generator.py, as suggested by Eric. Fixes the build issue reported here: https://www.redhat.com/archives/libvir-list/2012-April/msg01435.html Signed-off-by: Cole Robinson <crobinso@redhat.com> --- .gitignore | 1 + docs/Makefile.am | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 14a21d0..3cc30e8 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ /daemon/libvirtd.init /daemon/libvirtd.pod /daemon/libvirtd.service +/docs/apibuild.py.stamp /docs/devhelp/libvirt.devhelp /docs/hvsupport.html.in /docs/libvirt-api.xml diff --git a/docs/Makefile.am b/docs/Makefile.am index 53328f7..9bcc866 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -200,12 +200,19 @@ python_generated_files = \ $(srcdir)/libvirt-qemu-api.xml \ $(srcdir)/libvirt-qemu-refs.xml -$(python_generated_files): $(srcdir)/apibuild.py \ +APIBUILD="$(srcdir)/apibuild.py" +APIBUILD_STAMP="$(APIBUILD).stamp" + +$(python_generated_files): $(APIBUILD_STAMP) + +$(APIBUILD_STAMP): $(srcdir)/apibuild.py \ $(srcdir)/../include/libvirt/*.h \ $(srcdir)/../src/libvirt.c \ $(srcdir)/../src/libvirt-qemu.c \ $(srcdir)/../src/util/virterror.c - $(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/apibuild.py + $(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(APIBUILD) + touch $@ + check-local: all @@ -215,6 +222,7 @@ clean-local: maintainer-clean-local: clean-local rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml todo.html.in hvsupport.html.in rm -rf $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml + rm -rf $(APIBUILD_STAMP) rebuild: api qemu_api all -- 1.7.7.6

On 04/27/2012 10:59 AM, Cole Robinson wrote:
Use a witness file approach like we do for python/generator.py, as suggested by Eric. Fixes the build issue reported here:
https://www.redhat.com/archives/libvir-list/2012-April/msg01435.html
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- .gitignore | 1 + docs/Makefile.am | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)
ACK. A parallel make will now only run one instance of apibuild.py (for the stamp file) instead of several parallel instances (one for each $(python_generatedfile)), and it was the parallel instances that were stomping on one another. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 04/27/2012 12:59 PM, Cole Robinson wrote:
Use a witness file approach like we do for python/generator.py, as suggested by Eric. Fixes the build issue reported here:
https://www.redhat.com/archives/libvir-list/2012-April/msg01435.html
I think you're referencing the wrong message here. The message above is the one about the 99 character limit on paths in tar files. Here's the first mention I noticed of the problem (from Wen Congyang): https://www.redhat.com/archives/libvir-list/2012-April/msg01120.html

On Fri, Apr 27, 2012 at 12:59:46PM -0400, Cole Robinson wrote:
Use a witness file approach like we do for python/generator.py, as suggested by Eric. Fixes the build issue reported here:
https://www.redhat.com/archives/libvir-list/2012-April/msg01435.html
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- .gitignore | 1 + docs/Makefile.am | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore index 14a21d0..3cc30e8 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ /daemon/libvirtd.init /daemon/libvirtd.pod /daemon/libvirtd.service +/docs/apibuild.py.stamp /docs/devhelp/libvirt.devhelp /docs/hvsupport.html.in /docs/libvirt-api.xml diff --git a/docs/Makefile.am b/docs/Makefile.am index 53328f7..9bcc866 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -200,12 +200,19 @@ python_generated_files = \ $(srcdir)/libvirt-qemu-api.xml \ $(srcdir)/libvirt-qemu-refs.xml
-$(python_generated_files): $(srcdir)/apibuild.py \ +APIBUILD="$(srcdir)/apibuild.py" +APIBUILD_STAMP="$(APIBUILD).stamp" + +$(python_generated_files): $(APIBUILD_STAMP) + +$(APIBUILD_STAMP): $(srcdir)/apibuild.py \ $(srcdir)/../include/libvirt/*.h \ $(srcdir)/../src/libvirt.c \ $(srcdir)/../src/libvirt-qemu.c \ $(srcdir)/../src/util/virterror.c - $(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/apibuild.py + $(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(APIBUILD) + touch $@ +
check-local: all
@@ -215,6 +222,7 @@ clean-local: maintainer-clean-local: clean-local rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml todo.html.in hvsupport.html.in rm -rf $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml + rm -rf $(APIBUILD_STAMP)
rebuild: api qemu_api all
Something does not seem to be working correctly here. The docs/ directory now rebuilds every single time, even if nothing has changed $ make -s && make -s && make -s && make -s Making all in schemas GEN ./apibuild.py.stamp GEN html/index.html GEN devhelp/index.html Making all in schemas GEN ./apibuild.py.stamp Making all in schemas GEN ./apibuild.py.stamp GEN html/index.html GEN devhelp/index.html Making all in schemas GEN ./apibuild.py.stamp this in turn causes the python module to rebuild every time Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Ever since commit c964b6a, make was trying to find the timestamp of '""./apibuild.py".stamp"', but only touching 'apibuild.py.stamp', and thus always rebuilding. Reported by Daniel P. Berrange. * docs/Makefile.am (APIBUILD, APIBUILD_STAMP): Omit bogus quotes. --- Pushing under the trivial rule. 'make --debug' to the rescue! docs/Makefile.am | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 9bcc866..a03ca3e 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -## Copyright (C) 2005-2011 Red Hat, Inc. +## Copyright (C) 2005-2012 Red Hat, Inc. ## See COPYING.LIB for the License of this software SUBDIRS= schemas @@ -200,8 +200,8 @@ python_generated_files = \ $(srcdir)/libvirt-qemu-api.xml \ $(srcdir)/libvirt-qemu-refs.xml -APIBUILD="$(srcdir)/apibuild.py" -APIBUILD_STAMP="$(APIBUILD).stamp" +APIBUILD=$(srcdir)/apibuild.py +APIBUILD_STAMP=$(APIBUILD).stamp $(python_generated_files): $(APIBUILD_STAMP) -- 1.7.7.6

On Fri, May 11, 2012 at 08:24:06AM -0600, Eric Blake wrote:
Ever since commit c964b6a, make was trying to find the timestamp of '""./apibuild.py".stamp"', but only touching 'apibuild.py.stamp', and thus always rebuilding. Reported by Daniel P. Berrange.
* docs/Makefile.am (APIBUILD, APIBUILD_STAMP): Omit bogus quotes. ---
Pushing under the trivial rule. 'make --debug' to the rescue!
docs/Makefile.am | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am index 9bcc866..a03ca3e 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in
-## Copyright (C) 2005-2011 Red Hat, Inc. +## Copyright (C) 2005-2012 Red Hat, Inc. ## See COPYING.LIB for the License of this software
SUBDIRS= schemas @@ -200,8 +200,8 @@ python_generated_files = \ $(srcdir)/libvirt-qemu-api.xml \ $(srcdir)/libvirt-qemu-refs.xml
-APIBUILD="$(srcdir)/apibuild.py" -APIBUILD_STAMP="$(APIBUILD).stamp" +APIBUILD=$(srcdir)/apibuild.py +APIBUILD_STAMP=$(APIBUILD).stamp
$(python_generated_files): $(APIBUILD_STAMP)
Ahhhh, I was going mad trying to spot the flaw :-) ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (4)
-
Cole Robinson
-
Daniel P. Berrange
-
Eric Blake
-
Laine Stump