Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | From: Robert Yang <liezhi.yang@windriver.com> |
| 2 | Date: Sun, 22 Sep 2013 23:21:01 -0400 |
| 3 | Subject: [PATCH] src/Makefile.am: fix race issue for _gen/gtypes.h and _gen/gtypes-body.h |
| 4 | |
| 5 | There might be an error when parallel build: |
| 6 | |
| 7 | [snip] |
| 8 | Traceback (most recent call last): |
| 9 | File "/path/to/tools/glib-gtypes-generator.py", line 304, in <module> |
| 10 | GTypesGenerator(dom, argv[1], argv[2])() |
| 11 | File "/path/to/tools/glib-gtypes-generator.py", line 295, in __call__ |
| 12 | file_set_contents(self.output + '.h', ''.join(self.header)) |
| 13 | File "/path/to/tools/libtpcodegen.py", line 42, in file_set_contents |
| 14 | os.rename(filename + '.tmp', filename) |
| 15 | OSError: [Errno 2] No such file or directory |
| 16 | [snip] |
| 17 | |
| 18 | This is a race issue, the _gen/gtypes.h and _gen/gtypes-body.h may |
| 19 | write(remove/rename) _gen/gtypes.tmp at the same time, then there would |
| 20 | be the error. |
| 21 | |
| 22 | There was a similar bug in telepathy-glib which was already fixed, we use the |
| 23 | similar patch to fix it. |
| 24 | |
| 25 | Upstream-Status: Pending |
| 26 | |
| 27 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> |
| 28 | --- |
| 29 | src/Makefile.am | 18 +++++++++++++++--- |
| 30 | 1 file changed, 15 insertions(+), 3 deletions(-) |
| 31 | |
| 32 | diff --git a/src/Makefile.am b/src/Makefile.am |
| 33 | --- a/src/Makefile.am |
| 34 | +++ b/src/Makefile.am |
| 35 | @@ -288,7 +288,11 @@ _gen/interfaces-body.h: _gen/mcd.xml \ |
| 36 | $(tools_dir)/glib-interfaces-body-generator.xsl \ |
| 37 | $< > $@ |
| 38 | |
| 39 | -_gen/gtypes.h _gen/gtypes-body.h: _gen/mcd.xml \ |
| 40 | +# do nothing, output as a side-effect |
| 41 | +_gen/gtypes.h: _gen/gtypes-body.h |
| 42 | + @: |
| 43 | + |
| 44 | +_gen/gtypes-body.h: _gen/mcd.xml \ |
| 45 | $(top_srcdir)/tools/glib-gtypes-generator.py |
| 46 | $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \ |
| 47 | $< _gen/gtypes mc |
| 48 | @@ -309,7 +313,11 @@ _gen/%.xml: %.xml $(wildcard $(top_srcdir)/xml/*.xml) Makefile.am |
| 49 | $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \ |
| 50 | $< > $@ |
| 51 | |
| 52 | -_gen/cli-%-body.h _gen/cli-%.h: _gen/%.xml \ |
| 53 | +# do nothing, output as a side-effect |
| 54 | +_gen/cli-%.h: _gen/cli-%-body.h |
| 55 | + @: |
| 56 | + |
| 57 | +_gen/cli-%-body.h: _gen/%.xml \ |
| 58 | $(tools_dir)/glib-client-gen.py Makefile.am |
| 59 | $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \ |
| 60 | --group=`echo $* | tr x- x_` \ |
| 61 | @@ -317,7 +325,11 @@ _gen/cli-%-body.h _gen/cli-%.h: _gen/%.xml \ |
| 62 | --tp-proxy-api=0.7.6 \ |
| 63 | $< Mc_Cli _gen/cli-$* |
| 64 | |
| 65 | -_gen/svc-%.c _gen/svc-%.h: _gen/%.xml \ |
| 66 | +# do nothing, output as a side-effect |
| 67 | +_gen/svc-%.h: _gen/svc-%.c |
| 68 | + @: |
| 69 | + |
| 70 | +_gen/svc-%.c: _gen/%.xml \ |
| 71 | $(tools_dir)/glib-ginterface-gen.py Makefile.am |
| 72 | $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ |
| 73 | --filename=_gen/svc-$* \ |
| 74 | -- |
| 75 | 1.7.10.4 |
| 76 | |