telepathy-rakia: Avoid having two of the same set of commands run in parallel

Simon McVittie smcv at kemper.freedesktop.org
Tue Jun 4 04:29:05 PDT 2013


Module: telepathy-rakia
Branch: master
Commit: a942b597feb553eb72d1d984741b35e91c94aae8
URL:    http://cgit.freedesktop.org/telepathy/telepathy-rakia/commit/?id=a942b597feb553eb72d1d984741b35e91c94aae8

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Mon Jun  3 15:31:26 2013 +0100

Avoid having two of the same set of commands run in parallel

A rule like this:

    _gen/x.c _gen/x.h: prerequisites
        $(AM_V_GEN)x-generator

doesn't consider x.c and x.h together. Instead, it expands to two rules,
one to generate x.c and one to generate x.h, which happen to run the
same commands.

This means that in the worst case, you can end up running x-generator
twice in parallel, and they'll race with each other and overwrite or
delete each other's output.

Based on commit 36c2a545c from telepathy-glib.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64285
Signed-off-by: Simon McVittie <simon.mcvittie at collabora.co.uk>
Reviewed-by: Xavier Claessens <xavier.claessens at collabora.co.uk>

---

 extensions/Makefile.am |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index 8208a7e..f99d103 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -58,8 +58,9 @@ extensions.html: _gen/all.xml $(tools_dir)/doc-generator.xsl
 		$(tools_dir)/doc-generator.xsl \
 		$< > $@
 
-_gen/gtypes.h _gen/gtypes-body.h: _gen/all.xml \
-	$(top_srcdir)/tools/glib-gtypes-generator.py
+_gen/gtypes.h: _gen/gtypes-body.h
+	@: # do nothing, output as a side-effect
+_gen/gtypes-body.h: _gen/all.xml $(top_srcdir)/tools/glib-gtypes-generator.py
 	$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \
 		$< _gen/gtypes RAKIA
 
@@ -109,8 +110,9 @@ _gen/channel.xml: channel.xml $(wildcard *.xml)
 	$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
 		$< > $@
 
-_gen/svc-channel.c _gen/svc-channel.h: _gen/channel.xml \
-	$(tools_dir)/glib-ginterface-gen.py
+_gen/svc-channel.h: _gen/svc-channel.c
+	@: # do nothing, output as a side-effect
+_gen/svc-channel.c: _gen/channel.xml $(tools_dir)/glib-ginterface-gen.py
 	$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \
 		--filename=_gen/svc-channel \
 		--signal-marshal-prefix=_rakia_ext \



More information about the telepathy-commits mailing list